Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
coloring STDERR to terminal
- X-seq: zsh-users 7605
- From: Atom 'Smasher' <atom@xxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: coloring STDERR to terminal
- Date: Sun, 27 Jun 2004 19:22:21 -0400 (EDT)
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
i'm not sure if this is possible without patching some sources, but here's
what i want to do... every time STDERR is directed to a terminal, i want
to filter it through _something_like_ this:
awk '{print "^[[91m"$0"^[[0m"}'
i want my STDERR to be a different color than my STDOUT (when STDERR is
being directed to my terminal).
is there a way to do that in my dot-zshrc?
it would be neat if i could do some tricks with exec and shuffle STDERR
through a filter like that... i'm not sure if it would be better to invoke
`awk` once per shell, or every time STDERR is directed to a terminal...
both ways have drawbacks. i'm not sure that's it's even possible to do it
that way... or, if done that way, if it's possible to differentiate
between output going to a terminal or not.
ideally, i think this would require a new environment variable... maybe
something like STDERR_COLOR, and can probably just take an integer as a
value and fill in the control sequences around it... among other
advantages, there'd be no dependence on an external application. also,
that's probably the only way to accurately deal with situations when
STDERR isn't followed by a newline before STDOUT comes along.
if i was any good at coding in C i'd write a patch... but C is still on my
list of things to master.
thanks...
...atom
_________________________________________
PGP key - http://atom.smasher.org/pgp.txt
762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808
-------------------------------------------------
"The conservation movement is a breeding ground of Communists
and other subversives. We intend to clean them out, even if
it means rounding up every bird watcher in the country."
-- John Mitchell, US Atty. General 1969-1972
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.3.6 (FreeBSD)
Comment: What is this gibberish?
Comment: http://atom.smasher.org/links/#digital_signatures
iEYEARECAAYFAkDfVrIACgkQnCgLvz19QeOxOQCdHBPSy1F/k2Sr69kPCN0XCBEo
OxoAn3y5XBWYEq8qAm8sMKduHpsfy6RS
=csXO
-----END PGP SIGNATURE-----
Messages sorted by:
Reverse Date,
Date,
Thread,
Author