Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: coloring STDERR to terminal
- X-seq: zsh-users 7722
- From: Wayne Davison <wayned@xxxxxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: coloring STDERR to terminal
- Date: Tue, 20 Jul 2004 23:23:56 -0700
- In-reply-to: <Pine.LNX.4.61.0407202008240.14830@xxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <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> <20040720233037.GI28269@xxxxxxxxx> <Pine.LNX.4.61.0407202008240.14830@xxxxxxxxxxxxxxxxxx>
On Tue, Jul 20, 2004 at 08:15:26PM -0700, Bart Schaefer wrote:
> you can't invoke it blindly/automatically on every spawned command,
> because it will play havoc with any text editor or other fullscreen
> UI.
This works the other way around -- you invoke a shell inside it and it
colors all the stderr I/O of everything the shell runs. I ran an editor
just fine (vim) from a zsh running under it without any havoc.
> 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().
Yeah, I thought of that too while I was eating. I have them reversed in
the latest code on my website. I also enhanced the code to forward the
SIGWINCH signal (so that the shell resizes properly) and I moved some of
the code into functions (to make it easier to read). It seems to work
adequately in my limited testing, but it's probably not super portable.
Compiling note -- under Linux you need to specify -lutil, like this:
gcc -o color-my-world color-my-world.c -lutil
..wayne..
Messages sorted by:
Reverse Date,
Date,
Thread,
Author