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

Re: coloring STDERR to terminal

On 2004-06-30 09:56:37 -0700, Bart Schaefer wrote:
> On Wed, 30 Jun 2004, Vincent Lefevre wrote:
> > And is it possible to hide the coprocess from the jobs table?
> Older versions of zsh did that -- the coprocess was not managed as a job 
> at all, in fact -- but it was changed because (with the old behavior) 
> there was no clean way to send termination signals etc. to the coprocess.
> So at present, no, it's not possible to hide the coprocess.

Couldn't the coprocess be marked in a special way, to send termination
signals, etc.?

> > 1) I type Ctrl-d.
> > 2) "zsh: you have running jobs." is written by zsh to stderr (will be
> >    read by the coprocess).
> > 3) precmd() is called (but there are still no bytes sent by the
> >    coprocess).
> At this point the "read -p" in precmd() will block, because the coproc
> has not yet executed "print -n $'\0'".  So your step (4) won't happen:
> > 4) The new prompt is displayed (sent to the tty).

I don't understand why it will block. The line you gave was:

  while read -t -p -k 1; do :; done

and the zshbuiltins(1) man page says:

     -t [ num ]
            Test if input is available before attempting to read.  If
            num  is  present,  it must begin with a digit and will be
            evaluated to give a number of seconds,  which  may  be  a
            floating point number; in this case the read times out if
            input is not available within this time.  If num  is  not
            present,  it  is  taken  to be zero, so that read returns
            immediately if no input is available.   If  no  input  is
            available,  return status 1 and do not set any variables.

Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% validated (X)HTML - Acorn / RISC OS / ARM, free software, YP17,
Championnat International des Jeux Mathématiques et Logiques, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA

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