Zsh Mailing List Archive
Messages sorted by:
Re: coloring STDERR to terminal
- X-seq: zsh-users 7719
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: coloring STDERR to terminal
- Date: Tue, 20 Jul 2004 14:15:07 -0700 (PDT)
- In-reply-to: <20040720151617.N326@willy_wonka>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20040627190433.Q27888@willy_wonka> <Pine.LNX.4.60.0406280815130.19831@xxxxxxxxxxxxxxxxxx> <20040629160826.GL2033@xxxxxxxxxxxxx> <Pine.LNX.4.60.0406291002300.31134@xxxxxxxxxxxxxxxxxx> <20040630070902.GO2033@xxxxxxxxxxxxx> <Pine.LNX.4.60.0406300311020.5600@xxxxxxxxxxxxxxxxxx> <20040630114341.GR2033@xxxxxxxxxxxxx> <Pine.LNX.4.60.0406300906100.5600@xxxxxxxxxxxxxxxxxx> <20040701181459.GF2033@xxxxxxxxxxxxx> <Pine.LNX.4.60.0407011645450.16728@xxxxxxxxxxxxxxxxxx> <20040702124259.GS2033@xxxxxxxxxxxxx> <20040720045514.V326@willy_wonka> <Pine.LNX.4.61.0407200805410.7638@xxxxxxxxxxxxxxxxxx> <20040720151617.N326@willy_wonka>
- Reply-to: zsh-users@xxxxxxxxxx
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.
Messages sorted by: