Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: coloring STDERR to terminal
- X-seq: zsh-users 7720
- From: Wayne Davison <wayned@xxxxxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: coloring STDERR to terminal
- Date: Tue, 20 Jul 2004 16:30:37 -0700
- In-reply-to: <Pine.LNX.4.61.0407201353480.12638@xxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <Pine.LNX.4.60.0406300311020.5600@xxxxxxxxxxxxxxxxxx> <20040630114341.GR2033@xxxxxxxxxxxxx> <Pine.LNX.4.60.0406300906100.5600@xxxxxxxxxxxxxxxxxx> <20040701181459.GF2033@xxxxxxxxxxxxx> <Pine.LNX.4.60.0407011645450.16728@xxxxxxxxxxxxxxxxxx> <20040702124259.GS2033@xxxxxxxxxxxxx> <20040720045514.V326@willy_wonka> <Pine.LNX.4.61.0407200805410.7638@xxxxxxxxxxxxxxxxxx> <20040720151617.N326@willy_wonka> <Pine.LNX.4.61.0407201353480.12638@xxxxxxxxxxxxxxxxxx>
On Tue, Jul 20, 2004 at 02:15:07PM -0700, Bart Schaefer wrote:
> What you're asking for is something to copy multiple inputs to a single
> output, simultaneously adding characters (the color codes) to those inputs
> 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.
>
> This is, pretty much by definition, impossible, except (sometimes) at the
> level of a kernel driver.
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.
Here's a link to a proof-of-concept C program that you can try out:
http://www.blorf.net/color-my-world.c
It spawns a shell and colors all the data sent to stderr. I've only
tested it just a little bit, so I don't know if having a separate pty
for stderr will cause any weird problems or not.
..wayne..
Messages sorted by:
Reverse Date,
Date,
Thread,
Author