Several things here:
- Can anyone point me at C code to decode ANSI console escape sequences?
- Is there a way to get Cygwin BASH to emulate a dumb old TTY?
Maybe this should be 2 questions.
Thanks.
Several things here:
Maybe this should be 2 questions.
Thanks.
It's a somewhat indirect answer, but the GNU ncurses library handles terminals of all sorts. One way of finding out which control sequences are applicable to ANSI terminals would be to decompile an ANSI terminal description:
This would give you the set of terminfo attributes that are used by curses programs to achieve effects on an ANSI terminal. Of course, you then have to know what those hieroglyphs mean.
On Cygwin, I got:
The '
\E
' notation refers to the ESC character.Failing that, you could look up the standard itself.
Tweaking the TERM environment variable might make applications based on terminfo/termcap avoid using advanced escape sequences. (export TERM=dumb) I am not sure that's what you want, though.