From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7270 invoked from network); 30 Jul 2004 11:53:57 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 30 Jul 2004 11:53:57 -0000 Received: (qmail 53455 invoked from network); 30 Jul 2004 11:53:51 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 30 Jul 2004 11:53:51 -0000 Received: (qmail 14430 invoked by alias); 30 Jul 2004 11:53:07 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7788 Received: (qmail 14419 invoked from network); 30 Jul 2004 11:53:06 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by 130.225.247.90 with SMTP; 30 Jul 2004 11:53:06 -0000 Received: (qmail 52151 invoked from network); 30 Jul 2004 11:51:08 -0000 Received: from lyta.akte.de (217.160.134.217) by a.mx.sunsite.dk with SMTP; 30 Jul 2004 11:51:07 -0000 Received: (root@lyta.akte.de) by lyta.akte.de id ; Fri, 30 Jul 2004 13:51:03 +0200 KRecCount: 1 KInfo: virscan ok KInfo: NoRelay, NoSpam Received: from condor.int.spiegl.de (pD9E93165.dip.t-dialin.net [217.233.49.101]) by lyta.akte.de via kasmail (2.9) id ; Fri, 30 Jul 2004 11:50:25 GMT Received: from condor.int.spiegl.de (spiegl@localhost [127.0.0.1]) by condor.int.spiegl.de (8.12.11.Beta0/8.12.11.Beta0/Debian-1) with ESMTP id i6UBoOmM014062 for ; Fri, 30 Jul 2004 13:50:24 +0200 Received: (from spiegl@localhost) by condor.int.spiegl.de (8.12.11.Beta0/8.12.11.Beta0/Debian-1) id i6UBoOLB014060 for zsh-users@sunsite.dk; Fri, 30 Jul 2004 13:50:24 +0200 X-Authentication-Warning: condor.int.spiegl.de: spiegl set sender to zsh.Andy@spiegl.de using -f Date: Fri, 30 Jul 2004 13:50:24 +0200 From: Andy Spiegl To: zsh-users@sunsite.dk Subject: Re: coloring STDERR to terminal Message-ID: <20040730115024.GA25889@spiegl.de> Mail-Followup-To: zsh-users@sunsite.dk References: <20040629160826.GL2033@ay.vinc17.org> <20040630070902.GO2033@ay.vinc17.org> <20040630114341.GR2033@ay.vinc17.org> <20040701181459.GF2033@ay.vinc17.org> <20040702124259.GS2033@ay.vinc17.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040702124259.GS2033@ay.vinc17.org> X-PGP-GPG-Keys: mail -s "send pgp" auto@spiegl.de X-Accepted-File-Formats: ASCII .rtf .ps .pdf - *NO* MS Office files please. X-why-you-shouldnt-use-MS-LookOut: http://www.jensbenecke.de/l-oe-en.php X-warum-man-MS-Outlook-vermeiden-sollte: http://www.jensbenecke.de/l-oe-de.php X-Message-Flag: LookOut! You are using an insecure mail reader which can be used to spread viruses. User-Agent: Mutt/1.5.5.1+cvs20040105i X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=-3.3 required=6.0 tests=BAYES_00,RCVD_IN_NJABL, RCVD_IN_SORBS autolearn=no version=2.63 X-Spam-Hits: -3.3 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.