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

Re: coloring STDERR to terminal



On Tue, 20 Jul 2004, Wayne Davison wrote:

> On Tue, Jul 20, 2004 at 02:15:07PM -0700, Bart Schaefer wrote:
> > yet without mixing the result any differently than it would have been 
> > mixed if the writers of all those inputs had instead written directly 
> > to that single output.
> 
> It's impossible with a single tty (or pty), but if stdout and stderr
> each had their own pty, then a program could merge the two ptys to the
> real terminal, coloring the stderr one.

Yes, I said something about that before.  This is as close as you can get 
to what was asked for, but (a) it's still not precisely the same [*] as if 
both streams went directly to a single TTY, and (b) you can't invoke it 
blindly/automatically on every spawned command, because it will play havoc 
with any text editor or other fullscreen UI.

[*] E.g. your sample program always writes stdout first and then stderr, 
even when both are found to be available by the same call to select().



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