From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12510 invoked from network); 20 Jul 2004 23:33:16 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 20 Jul 2004 23:33:16 -0000 Received: (qmail 87682 invoked from network); 20 Jul 2004 23:33:10 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 20 Jul 2004 23:33:10 -0000 Received: (qmail 17895 invoked by alias); 20 Jul 2004 23:32:26 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7720 Received: (qmail 17879 invoked from network); 20 Jul 2004 23:32:26 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by 130.225.247.90 with SMTP; 20 Jul 2004 23:32:26 -0000 Received: (qmail 85673 invoked from network); 20 Jul 2004 23:30:42 -0000 Received: from dsl3-63-249-88-2.cruzio.com (HELO binome.blorf.net) (63.249.88.2) by a.mx.sunsite.dk with SMTP; 20 Jul 2004 23:30:40 -0000 Received: by binome.blorf.net (Postfix, from userid 1000) id 56864265A; Tue, 20 Jul 2004 16:30:37 -0700 (PDT) Date: Tue, 20 Jul 2004 16:30:37 -0700 From: Wayne Davison To: zsh-users@sunsite.dk Subject: Re: coloring STDERR to terminal Message-ID: <20040720233037.GI28269@blorf.net> References: <20040630114341.GR2033@ay.vinc17.org> <20040701181459.GF2033@ay.vinc17.org> <20040702124259.GS2033@ay.vinc17.org> <20040720045514.V326@willy_wonka> <20040720151617.N326@willy_wonka> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6+20040523i 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 On Tue, Jul 20, 2004 at 02:15:07PM -0700, Bart Schaefer wrote: > What you're asking for is something to copy multiple inputs to a single > output, simultaneously adding characters (the color codes) to those inputs > yet without mixing the result any differently than it would have been > mixed if the writers of all those inputs had instead written directly to > that single output. > > This is, pretty much by definition, impossible, except (sometimes) at the > level of a kernel driver. It's impossible with a single tty (or pty), but if stdout and stderr each had their own pty, then a program could merge the two ptys to the real terminal, coloring the stderr one. Here's a link to a proof-of-concept C program that you can try out: http://www.blorf.net/color-my-world.c It spawns a shell and colors all the data sent to stderr. I've only tested it just a little bit, so I don't know if having a separate pty for stderr will cause any weird problems or not. ..wayne..