Re: How to print colored text to a linux terminal?

From: Thomas Dickey (dickey_at_saltmine.radix.net)
Date: 06/04/04


Date: Fri, 04 Jun 2004 18:45:08 -0000

Floyd L. Davidson <floyd@barrow.com> wrote:

> One conclusion might be that, since it is actually fairly
> difficult to find a non-ANSI terminal these days, hard coding
> escape sequences does have the advantage of making the script
> "work" on all conforming terminals, even if the TERM variable is
> not correct. Of course, any terminal or emulator that doesn't
> match the hard coded escapes is then useless.

on the other hand, using Linux console_codes manpage as a guide to portability
does not work well (for several reasons).

Limiting the escape sequences to those which are commonly found in
terminfo/termcap is a good start.

Using terminfo itself (rather than hardcoding) tends to avoid the recurring
problem of hardcoded applications that are no longer maintainable, etc.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net