Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: coloring STDERR to terminal
- X-seq: zsh-users 7788
- From: Andy Spiegl <zsh.Andy@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: coloring STDERR to terminal
- Date: Fri, 30 Jul 2004 13:50:24 +0200
- In-reply-to: <20040702124259.GS2033@xxxxxxxxxxxxx>
- Kinfo: virscan ok
- Kinfo: NoRelay, NoSpam
- Kreccount: 1
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <Pine.LNX.4.60.0406280815130.19831@xxxxxxxxxxxxxxxxxx> <20040629160826.GL2033@xxxxxxxxxxxxx> <Pine.LNX.4.60.0406291002300.31134@xxxxxxxxxxxxxxxxxx> <20040630070902.GO2033@xxxxxxxxxxxxx> <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>
Hi everyone,
I'd followed the discussion closely because I also thought coloring of
stderr to be a great thing to have. I ended up using Vincents way:
> exec 2>>(while read line; do
> print '\e[91m'${(q)line}'\e[0m' > /dev/tty; done &)
Which seems to work nicely, well except for the reordering of lines
sometimes, but I could live with that.
However there is one situation where output not only is out of order but
doesn't appear at all:
condor% echo $ZSH_VERSION
4.2.0
condor% touch foo bar
condor% cp -i foo bar
cp: overwrite `bar'? y
condor% exec 2>>(while read line; do print '\e[91m'${(q)line}'\e[0m' > /dev/tty; done &)
condor% cp -i foo bar
y
As you can see the question doesn't appear at all!
But when I then do this, it suddenly appears:
condor% echo test >&2
condor% cp: overwrite `bar'? test
So it seems that zsh doesn't flush some buffer?
Is that a zsh-bug or a problem with this exec-trick?
Chau,
Andy.
--
o _ _ _
------- __o __o /\_ _ \\o (_)\__/o (_) -o)
----- _`\<,_ _`\<,_ _>(_) (_)/<_ \_| \ _|/' \/ /\\
---- (_)/ (_) (_)/ (_) (_) (_) (_) (_)' _\o_ _\_v
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The brain is a wonderful organ; it starts working the moment you get up
in the morning, and does not stop until you get to work.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author