From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12200 invoked from network); 15 Feb 2005 13:26:52 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 15 Feb 2005 13:26:52 -0000 Received: (qmail 16258 invoked from network); 15 Feb 2005 13:26:47 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 15 Feb 2005 13:26:47 -0000 Received: (qmail 10527 invoked by alias); 15 Feb 2005 13:26:30 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8503 Received: (qmail 7811 invoked from network); 15 Feb 2005 13:19:48 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 15 Feb 2005 13:19:48 -0000 Received: (qmail 12019 invoked from network); 15 Feb 2005 13:19:44 -0000 Received: from caly80.spider.com (HELO bifrost.spider.com) (194.217.109.12) by a.mx.sunsite.dk with SMTP; 15 Feb 2005 13:19:40 -0000 Received: from no.name.available by bifrost.spider.com via smtpd (for thor.dotsrc.org [130.225.247.86]) with SMTP; 15 Feb 2005 13:19:40 UT Received: from heimdall-dmz.spider.com (mailhub.spider.com [212.240.99.13]) by caly80.spider.com (Postfix) with SMTP id 17BC76F5D for ; Tue, 15 Feb 2005 13:19:37 +0000 (GMT) Received: from mailhub.spider.com by heimdall-dmz.spider.com via smtpd (for [172.16.254.22]) with SMTP; 15 Feb 2005 13:19:37 UT Received: from localhost (duey.spider.com [212.240.99.128]) by batistuta.spider.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id 1RT74DLK; Tue, 15 Feb 2005 13:16:16 -0000 Date: Tue, 15 Feb 2005 13:19:35 +0000 From: Stephane Chazelas To: Zsh users list Subject: vared in scripts and history Message-ID: <20050215131935.GA21734@duey.spider.com> Mail-Followup-To: Zsh users list Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.7i X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 Hi list, I've got a question. I'd like to add a vared like line editor to some interactive command. I've noted the "nslookup" user function approach, but I was thinking of another way to do it, that would be more flexible: use GNU screens :exec functionality. Basically, if (within screen) I run: screen -X exec '.!.' ./zf $TTY; tr a-z A-Z Where zf is: #! /usr/bin/env zsh trap 'printf "\03"; exit' INT while a=; vared -p "$2" -e a; do { s=$(stty -g) stty -echo printf "%s\r" "$a" stty "$s" } < $1 done printf "\04" I get the terminal builtin line editor replaced with zsh's line editor for tr. Which is already great. Now, I'd like to add some history support. But I couldn't have it to work. Is there any way? TIA Stephane