From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20658 invoked by alias); 31 Dec 2012 05:30:07 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17514 Received: (qmail 14847 invoked from network); 31 Dec 2012 05:30:06 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID,T_TO_NO_BRKTS_FREEMAIL autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.223.176 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=gI0i2BfkrlBhr5NaQJWz0UiFwGT852aAWVKsYivr/ug=; b=0MXiTwNdOrg4DCBjJq911cs6HcMD/t88ylWwWXdXcEETENGGQFiFwltTAhZeI7Qkx5 A59vYgW8FF/A7dt7JlIpkJJOSF+a6MWREoDp0aphEUVCLuP0bTPtDAYWPXWNC4VwDnLW FvuLFnkI4QIBDGhoS9G1KTScf9U4ZrfsT+SaBFuJVW7BuJlykxnTuvO3DdbKX+xaDXiX NreMZAUXyHrn7UN6Wyd6Rd1YUD68g+XkL+2b4/izgyHseNpjzWIR10N6FinB35tKIZJG fbAIy8pKdjVDiN3ib+jbt0AQdMi8Vh7H/wYpM9PTjdpSdWmwIDq3CaG6Ru30jt3ohRzo nnng== MIME-Version: 1.0 Date: Mon, 31 Dec 2012 10:59:59 +0530 Message-ID: Subject: Implementing a menu (list) in a zsh script (as in command line) From: rahul To: zsh-users@zsh.org Content-Type: multipart/alternative; boundary=14dae9340567ea1dc804d21f4d34 --14dae9340567ea1dc804d21f4d34 Content-Type: text/plain; charset=UTF-8 I am writing an application in zsh. I typically use read -k or vared for getting user input. However, I'd like the user to get a menu as he types or tabs, just as it happens on the zsh command line. I'd like him to be able to navigate the menu just as on the command line. Currently, I've implemented this in some cases using read -k and displaying the data again with each keystroke and the user has to type in the row number to finally select a row. However, user cannot navigate. I'd like to use zsh's inbuilt facilities if possible rather than reimplement. Also in the case of using vared, I am unable to give any options (although if it happens to be a path, then vared does allow tabbing and completion). I did see an application that does implement something similar called "zaw". It seems to use "zle" but I was lost reading the code. "man zle" hasn't helped much and I could not find any simple tutorial or examples. Also, using "read -k" can one accept control characters and arrow keys ? It seems I would have to do multiple reads? --14dae9340567ea1dc804d21f4d34--