Color your terminal's output

Jens Mueller jens.k.mueller at gmx.de
Mon Oct 10 03:21:34 PDT 2011


Marco Leise wrote:
> Am 09.10.2011, 12:32 Uhr, schrieb Jens Mueller <jens.k.mueller at gmx.de>:
> 
> >Johannes Pfau wrote:
> >>Jens Mueller wrote:
> >>BTW: you could also use isatty (http://linux.die.net/man/3/isatty) to
> >>detect if stdout has been redirected and disable color output in that
> >>case.
> >>For windows:
> >>https://forums.embarcadero.com/thread.jspa?threadID=21194
> >>or
> >>http://msdn.microsoft.com/de-de/library/f4s0ddew(v=vs.80).aspx
> >
> >Nice idea. Thanks.
> >
> >Jens
> 
> But allow the programmer to force color output anyway. In some cases
> you redirect to a program that itself supports or passes through
> escape sequences. "grep --color=always <regex> <file> | less" would
> be an example of that.

Make sense.
Thanks.

Jens


More information about the Digitalmars-d mailing list