From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8310 invoked from network); 11 Jun 1997 05:45:41 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 11 Jun 1997 05:45:41 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id BAA27164; Wed, 11 Jun 1997 01:37:02 -0400 (EDT) Resent-Date: Wed, 11 Jun 1997 01:37:02 -0400 (EDT) Date: Wed, 11 Jun 1997 09:41:05 +0400 (MSD) From: Andrej Borsenkow X-Sender: bor@itsrm1 Reply-To: borsenkow.msk@sni.de To: Zefram cc: zsh-workers@math.gatech.edu Subject: Re: Qustions about ZLE widgets. In-Reply-To: <6793.199706101412@stone.dcs.warwick.ac.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Resent-Message-ID: <"ll12o.0.Ne6.-bZdp"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/3231 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Tue, 10 Jun 1997, Zefram wrote: > Andrej Borsenkow wrote: > >dup_characters () { > > local char > > BUFFER="" > > read -k char > > I do not recommend using `read' in a widget function. I expect it will > screw up the tty mode. When I find the time to implement it, there will > be a proper way to input characters within ZLE. (It would be nice to > make read safe to call from within ZLE anyway.) > Yes, thanks. As long as I don't use read, it works quite well (but note, man to zle builtuin doesn't place any restrictions on what widget function can do). What happens, when functions calls some external program which changes tty mode? May be, ZLE has to restore tty settings (and buffer) after user defined widget exits? > > BUFFER="$BUFFER""$char""$char" > > "$BUFFER" is guaranteed to be empty at this point, as you cleared > it above. Is this what you intend? > Ohh ... I started with something more elanorate, but as it didn't work, I cut it down to above example. Sorry, looks silly, I know ... :-( thanx ------------------------------------------------------------------------- Andrej Borsenkow Fax: +7 (095) 252 01 05 SNI ITS Moscow Tel: +7 (095) 252 13 88 NERV: borsenkow.msk E-Mail: borsenkow.msk@sni.de -------------------------------------------------------------------------