zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: kynn@panix.com
Cc: zsh-users@sunsite.dk
Subject: Re: Advanced scripting Q: notification to tty
Date: Mon, 3 Jan 2005 08:37:25 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.61.0501030832190.32450@toltec.zanshin.com> (raw)
In-Reply-To: <200412241809.iBOI9lq12047@panix3.panix.com>

On Fri, 24 Dec 2004 kynn@panix.com 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.


      reply	other threads:[~2005-01-03 16:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-24 18:09 kynn
2005-01-03 16:37 ` Bart Schaefer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.61.0501030832190.32450@toltec.zanshin.com \
    --to=schaefer@brasslantern.com \
    --cc=kynn@panix.com \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).