Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Advanced scripting Q: notification to tty
- X-seq: zsh-users 8320
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: kynn@xxxxxxxxx
- Subject: Re: Advanced scripting Q: notification to tty
- Date: Mon, 3 Jan 2005 08:37:25 -0800 (PST)
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <200412241809.iBOI9lq12047@xxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <200412241809.iBOI9lq12047@xxxxxxxxxxxxxxxx>
- Reply-to: zsh-users@xxxxxxxxxx
On Fri, 24 Dec 2004 kynn@xxxxxxxxx wrote:
> I want to implement a notification by a function to the terminal
> controlling an interactive zsh
>
> [...] the shell's notification arrives while the user is in the middle
> of typing a multi-line command, so the shell re-creates the
> interrupted line for the user. *Very nicely done*.
>
> Does zsh provide any facilities for programmers to achieve this effect
> in shell scripts?
Yes, look at the "zle" command's -F option which allows you to install an
asynchronous I/O handler function in the line editor. See also "zle -I".
> Absent this, what is the best way to implement "synchronous"
> notification (i.e. one that happens only after the user hits the Enter
> key) in zsh scripts?
Have the notifier write to a named pipe (or use the coproc descriptor) and
examine that for available input in the user-definable precmd function.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author