From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13614 invoked from network); 27 Jun 2004 23:23:13 -0000 Received: from odin.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.85) by ns1.primenet.com.au with SMTP; 27 Jun 2004 23:23:13 -0000 Received: (qmail 22789 invoked from network); 28 Jun 2004 00:32:41 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 28 Jun 2004 00:32:41 -0000 Received: (qmail 26436 invoked by alias); 27 Jun 2004 23:22:34 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7605 Received: (qmail 26426 invoked from network); 27 Jun 2004 23:22:33 -0000 Received: from odin.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.85) by sunsite.dk with SMTP; 27 Jun 2004 23:22:33 -0000 Received: (qmail 21672 invoked from network); 28 Jun 2004 00:32:07 -0000 Received: from rso.suspicious.org (HELO research.suspicious.org) (69.55.224.62) by a.mx.sunsite.dk with SMTP; 28 Jun 2004 00:32:06 -0000 Received: (qmail 27006 invoked by uid 1002); 27 Jun 2004 23:22:28 -0000 Date: Sun, 27 Jun 2004 19:22:21 -0400 (EDT) From: Atom 'Smasher' To: zsh-users@sunsite.dk Subject: coloring STDERR to terminal Message-ID: <20040627190433.Q27888@willy_wonka> X-OpenPGP-KeyID: 0xB88D52E4D9F57808 (4096-RSA) X-OpenPGP-Fingerprint: 762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808 X-OpenPGP-URL: http://smasher.suspicious.org/pgp.txt MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 -----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-----