zsh-users
 help / color / mirror / code / Atom feed
From: Wayne Davison <wayned@users.sourceforge.net>
To: zsh-users@sunsite.dk
Subject: Re: coloring STDERR to terminal
Date: Tue, 20 Jul 2004 23:23:56 -0700	[thread overview]
Message-ID: <20040721062356.GA6709@blorf.net> (raw)
In-Reply-To: <Pine.LNX.4.61.0407202008240.14830@toltec.zanshin.com>

On Tue, Jul 20, 2004 at 08:15:26PM -0700, Bart Schaefer wrote:
> you can't invoke it blindly/automatically on every spawned command,
> because it will play havoc with any text editor or other fullscreen
> UI.

This works the other way around -- you invoke a shell inside it and it
colors all the stderr I/O of everything the shell runs.  I ran an editor
just fine (vim) from a zsh running under it without any havoc.

> 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().

Yeah, I thought of that too while I was eating.  I have them reversed in
the latest code on my website.  I also enhanced the code to forward the
SIGWINCH signal (so that the shell resizes properly) and I moved some of
the code into functions (to make it easier to read).  It seems to work
adequately in my limited testing, but it's probably not super portable.

Compiling note -- under Linux you need to specify -lutil, like this:

    gcc -o color-my-world color-my-world.c -lutil

..wayne..


  reply	other threads:[~2004-07-21  6:26 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-27 23:22 Atom 'Smasher'
2004-06-28  0:06 ` ari
2004-06-28  0:36   ` Atom 'Smasher'
2004-06-29 15:43 ` Bart Schaefer
2004-06-29 16:08   ` Vincent Lefevre
2004-06-29 17:14     ` Bart Schaefer
2004-06-30  7:09       ` Vincent Lefevre
2004-06-30 10:52         ` Bart Schaefer
2004-06-30 11:43           ` Vincent Lefevre
2004-06-30 12:01             ` Vincent Lefevre
2004-06-30 16:56             ` Bart Schaefer
2004-07-01 18:14               ` Vincent Lefevre
2004-07-02  0:11                 ` Bart Schaefer
2004-07-02 12:42                   ` Vincent Lefevre
2004-07-02 21:32                     ` Bart Schaefer
2004-07-20  9:10                     ` Atom 'Smasher'
2004-07-20 16:10                       ` Bart Schaefer
2004-07-20 19:27                         ` Atom 'Smasher'
2004-07-20 21:15                           ` Bart Schaefer
2004-07-20 23:30                             ` Wayne Davison
2004-07-21  3:15                               ` Bart Schaefer
2004-07-21  6:23                                 ` Wayne Davison [this message]
2004-07-21  7:30                                   ` Bart Schaefer
2004-07-21 13:19                                   ` Vincent Lefevre
2004-07-30 11:50                     ` Andy Spiegl
2004-07-30 23:44                       ` Vincent Lefevre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040721062356.GA6709@blorf.net \
    --to=wayned@users.sourceforge.net \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).