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

Re: PATCH: more selection



On Mon, 13 May 2002, Peter Stephenson wrote:

> This patch is more advanced warning of future pain than anything else,
> in case anyone wants to scream at the very idea.
>
> The following patch adds an fd-watching facility to zle.  You tell zle
> (via zle -F) to select on an fd and give it a function handler.  When data
> is available for reading on that handle (only reading, at the moment),
> the handler will be called, and zle will sail on without returning.
> This allows you to handle input from other sources while the shell is
> inactive waiting for terminal input.  It's all handled synchronously
> within zle, so it should be free of the hazards of asynchronous input.
>

Is it posible to extend it to set timeouts while waiting for input? This
could be used to update prompts as example (often asked question - how to
get time in prompt).

My only concern is that if there is any chance handler will block you can
just as well kill your shell - there is no way to give shell input
anymore.

-andrej



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