bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to interpret ansi escape code like "\033[; 1; 31mHello World\033


From: Thomas Dickey
Subject: Re: How to interpret ansi escape code like "\033[; 1; 31mHello World\033[0m"?
Date: Wed, 19 Nov 2008 13:13:52 -0500 (EST)

On Wed, 19 Nov 2008, Bernd Jendrissek wrote:

On Wed, Nov 19, 2008 at 6:31 PM, Bryan Christ <address@hidden> wrote:
It would be next to impossible for you to interpret ever possible
terminal definition (/usr/share/terminfo/*/*).  Instead, you need to
create your own terminfo definition or find one you think suits your
needs.  Then, call setenv() to set the TERM var before you call exec().
Once you have done this, your parser can deal strictly with predictable
escape sequences.

Is it always possible to install new terminfo entries, even if you aren't root?

yes (even without ncurses, you can set TERMINFO to point to your own directory; ncurses adds TERMINFO_DIRS to allow multiple directory locations for the terminfo entries).


One doesn't need to interpret ALL possible sequences - merely
interpret ONE (or a FEW) that you know are nearly universal (VT100 and
xterm would be good choices), and advertise that to the host.

...and make the parser ignore the ones that it doesn't recognize (so they're not displayed in bits and pieces).

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]