[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
Re: How to interpret ansi escape code like "\033[; 1; 31mHello World\033[0m"?
Mon, 17 Nov 2008 12:55:15 -0600
"Mutt's code is in pager.c, the grok_ansi() function, and only parses a
I should have mentioned in my previous email, the other part of the
strategy in creating your own interpreter is to also create your own
terminfo entry. This will allow you to restrict the kinds of escape
sequences which get transmitted to your input reader.
On Mon, 2008-11-17 at 18:45 +0000, Dan Nelson wrote:
> In the last episode (Nov 17), Thomas Dickey said:
> > On Mon, 17 Nov 2008, John Daker wrote:
> > > I'm writing a telnet client with ncurses, and I cannot handle ansi
> > > escape code like "\033[;1;31mHello World\033[0m" read through
> > > socket from a telnet server,
> > >
> > > Can ncurses parse ansi escape code to color system of himself?
> > no - I've considered making a demo to show this, but it wouldn't be
> > done in the library (long explanation...)
> > > Or is there any third party lib to do this?
> > I don't recall any, offhand -
> Both Mutt and Screen have code that parses ANSI color escape sequences.
> Mutt's code is in pager.c, the grok_ansi() function, and only parses a
> subset of the "\033[...m" escape sequence (just enough to display
> colors). Screen's is in ansi.c, and is a full VT100/ANSI emulator.
> Dan Nelson
> Bug-ncurses mailing list