From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17390 invoked from network); 21 Jul 2004 03:18:17 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 21 Jul 2004 03:18:17 -0000 Received: (qmail 76464 invoked from network); 21 Jul 2004 03:18:11 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 21 Jul 2004 03:18:11 -0000 Received: (qmail 20197 invoked by alias); 21 Jul 2004 03:17:29 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7721 Received: (qmail 20187 invoked from network); 21 Jul 2004 03:17:29 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by 130.225.247.90 with SMTP; 21 Jul 2004 03:17:29 -0000 Received: (qmail 74975 invoked from network); 21 Jul 2004 03:15:30 -0000 Received: from unknown (HELO moonbase.zanshin.com) (167.160.213.139) by a.mx.sunsite.dk with SMTP; 21 Jul 2004 03:15:27 -0000 Received: from toltec.zanshin.com (toltec.zanshin.com [64.84.47.166]) by moonbase.zanshin.com (8.12.11/8.12.11) with ESMTP id i6L3FQDt009830 for ; Tue, 20 Jul 2004 20:15:26 -0700 Date: Tue, 20 Jul 2004 20:15:26 -0700 (PDT) From: Bart Schaefer Reply-To: zsh-users@sunsite.dk To: zsh-users@sunsite.dk Subject: Re: coloring STDERR to terminal In-Reply-To: <20040720233037.GI28269@blorf.net> Message-ID: References: <20040630114341.GR2033@ay.vinc17.org> <20040701181459.GF2033@ay.vinc17.org> <20040702124259.GS2033@ay.vinc17.org> <20040720045514.V326@willy_wonka> <20040720151617.N326@willy_wonka> <20040720233037.GI28269@blorf.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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, 20 Jul 2004, Wayne Davison wrote: > On Tue, Jul 20, 2004 at 02:15:07PM -0700, Bart Schaefer wrote: > > 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. > > 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. Yes, I said something about that before. This is as close as you can get to what was asked for, but (a) it's still not precisely the same [*] as if both streams went directly to a single TTY, and (b) you can't invoke it blindly/automatically on every spawned command, because it will play havoc with any text editor or other fullscreen UI. [*] E.g. your sample program always writes stdout first and then stderr, even when both are found to be available by the same call to select().