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

Re: The `zle' command and traps



Bart Schaefer wrote:

> Here's an odd tidbit ... `zle' from a trap handler can actually affect the
> line editor, if and only if the signal happens to arrive while ZLE is
> active.  E.g. try
> 
> 	TMOUT=2 ; TRAPALRM() { zle -R "Hi there, I'm a trap." }
> 
> Of course if the signal arrives when ZLE is not active, this generates an
> ugly warning message.

I was about to add a/some test(s) for sfcontext in bin_zle()
but... this is quite cool, isn't it? ;-)

We had some people asking if it was possible to display the current
time in the prompt and have that updated even without having new
prompts displayed. Something like the above almost allows that.

So, should we disallow it completely? Or make the zle builtin be quiet
if zle isn't active? Make the zle special parameters accessible
(read-only) in traps if zle is active? Add a way to detect if zle is
active? Add a way to detect if (the shell thinks that) there is a
completion list displayed below the prompt? Etc, etc?

Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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