From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3361 invoked from network); 9 Jun 2004 14:33:51 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.86) by ns1.primenet.com.au with SMTP; 9 Jun 2004 14:33:51 -0000 Received: (qmail 8527 invoked from network); 9 Jun 2004 14:33:29 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 9 Jun 2004 14:33:29 -0000 Received: (qmail 29646 invoked by alias); 9 Jun 2004 14:33:21 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7500 Received: (qmail 29636 invoked from network); 9 Jun 2004 14:33:20 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.86) by sunsite.dk with SMTP; 9 Jun 2004 14:33:17 -0000 Received: (qmail 7891 invoked from network); 9 Jun 2004 14:33:17 -0000 Received: from madrid10.amenworld.com (62.193.203.32) by a.mx.sunsite.dk with SMTP; 9 Jun 2004 14:33:15 -0000 Received: from DervishD.pleyades.net (212.Red-80-35-44.pooles.rima-tde.net [80.35.44.212]) by madrid10.amenworld.com (8.10.2/8.10.2) with ESMTP id i59EXCw13343 for ; Wed, 9 Jun 2004 16:33:13 +0200 Received: from raul@pleyades.net by DervishD.pleyades.net with local (Exim MTA 2.05) id <1BY47t-0002lH-00>; Wed, 9 Jun 2004 16:32:25 +0200 Date: Wed, 9 Jun 2004 16:32:25 +0200 From: DervishD To: Zsh Users Subject: Interactive program in Zsh Message-ID: <20040609143225.GA10606@DervishD> Mail-Followup-To: Zsh Users Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.4.2.1i Organization: Pleyades X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 Hello all :) I need a program that processes some text and presents a few options to the user. I know how to do it using 'read -k' for reading keystrokes and using a couple of escape sequences and 'print' for printing the output, but I would like to use zle widgets for that. What I mean is that I would like to use widget names instead of escape sequences, something like getting 'up-line-or-history' instead of "^[[A" if the user presses 'up arrow', so I can use the key combo that the user wants for going up in a list instead of a fixed sequence. I don't know if this is the proper approach for what I need to do: the user is limited to use up arrow and down arrow for travelling into the list of options (maybe pg-up and pg-down for scrolling) and 'enter' to select the highlighted option. The program must process a text, present a list of options containing the text that matched certain regex and allow the user to choose one of the options. Could you please point me to a source of information? Is this a good approach or should I write a C program with ncurses? Portability is not an issue, so to say I want the program be 'zsh-portable', able to run in any zsh configuration (that's the reason I don't want to use key sequences). Thanks a lot in advance :) Raúl Núñez de Arenas Coronado -- Linux Registered User 88736 http://www.pleyades.net & http://raul.pleyades.net/