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

Re: coloring STDERR to terminal



On 2004-06-30 13:43:41 +0200, Vincent Lefevre wrote:
> Thanks for the explanation. But in fact, I didn't add the
> 
>   print -n $'\0'
> 
> line, so there is no R problem in my case. So, is this line really
> useful?

Hmm... I now see. It seems I got confused by the zshbuiltins man page,
which says:

              -p     Input is read from the coprocess.

Is it
  1) from the coprocess output, or
  2) sharing the coprocess input?

First I supposed (2); I think that this is really what I want.

But looking at the explanations, it seems to be (1); however, in this
case, there seems to be a race condition anyway, as the coprocess may
be too late to write its input to the tty, i.e. the following is
possible, isn't it?

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).
4) The new prompt is displayed (sent to the tty).
5) The coprocess reads a line.
6) The coprocess sends "zsh: you have running jobs." to the tty.
7) The coprocess sends a byte to stdout (too late!).

-- 
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