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

Re: coloring STDERR to terminal



On 2004-06-30 03:52:46 -0700, Bart Schaefer wrote:
> To clarify, by this I mean to its original standard output, not to the 
> redirected stdout which is going to /dev/tty (otherwise the parent zsh 
> can't see it).  E.g. instead of
> 
>  coproc while read line; print '\e[91m'${(q)line}'\e[0m' > /dev/tty
> 
> You need
> 
>  coproc while read line; do
>           print '\e[91m'${(q)line}'\e[0m' > /dev/tty
>           print -n $'\0'
>         done
[...]
> The situation is thus: The parent zsh (Z) holds the write-end (W) of the 
> standard input of coprocess (C), and the read end (R) of the standard 
> output of the coprocess.  Within the coprocess, the first print command 
> has its standard output redirected to the terminal (T), but the second is 
> still writing on R.
[...]

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?

Also, when I quit zsh, the coprocess is not killed (the NO_HUP option
is set, but a coprocess can be seen as a particular case). Is it a bug?

And is it possible to hide the coprocess from the jobs table?

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