From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4958 invoked from network); 20 Jul 2004 21:17:44 -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 21:17:44 -0000 Received: (qmail 87327 invoked from network); 20 Jul 2004 21:17:34 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 20 Jul 2004 21:17:34 -0000 Received: (qmail 8768 invoked by alias); 20 Jul 2004 21:16:49 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7719 Received: (qmail 8758 invoked from network); 20 Jul 2004 21:16:49 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by 130.225.247.90 with SMTP; 20 Jul 2004 21:16:49 -0000 Received: (qmail 85659 invoked from network); 20 Jul 2004 21:15:11 -0000 Received: from unknown (HELO moonbase.zanshin.com) (167.160.213.139) by a.mx.sunsite.dk with SMTP; 20 Jul 2004 21:15:08 -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 i6KLF7vH004006 for ; Tue, 20 Jul 2004 14:15:07 -0700 Date: Tue, 20 Jul 2004 14:15:07 -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: <20040720151617.N326@willy_wonka> Message-ID: References: <20040627190433.Q27888@willy_wonka> <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> <20040720045514.V326@willy_wonka> <20040720151617.N326@willy_wonka> 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, Atom 'Smasher' wrote: > you raise some intersting issues... and not being much of a C programmer > myself i'm not sure how to address them... my logic is that if the > coloring of STDOUT, STDERR and echoing STDIN is handled ~internally~ by > the shell, then everything else should (FTMP) work itself out. What you're missing is that the shell is not involved in the processing of these streams except insofar as it sets up the file descriptors used by the commands it spawns. All the shell does or can do is start the new process and then get out of the way until it is finished. The exception, in the case of zsh, is multios, where the shell explicitly sets up each of those file descriptors to point to a special subprocess that copies its single input to its multiple outputs as fast as it can. 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.