Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Qustions about ZLE widgets.



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@xxxxxx
-------------------------------------------------------------------------




Messages sorted by: Reverse Date, Date, Thread, Author