ANSI Colorized Terminal?
I have heard one rumor that Apple is shipping an incorrect termcap? Does anyone know the real answer?
Mac OS X (10.5.4)
Mac OS X (10.5.4)
echo $TERM
if has("terminfo")
let &t_Co=8
let &t_Sf="e[3%p1%dm"
let &t_Sb="e[4%p1%dm"
else
let &t_Co=8
let &t_Sf="e[3%dm"
let &t_Sb="e[4%dm"
endif
if $TERM == "xterm-16color"
let &t_Co=16 " xterm-16color has 16 colors minimum.
endif
# -foreground- ----bold---- -underline-- --reverse--- -background-
# black e[30m e[30;1m e[30;4m e[30;7m e[40;fg;1m
# red e[31m e[31;1m e[31;4m e[31;7m e[41;fg;1m
# green e[32m e[32;1m e[32;4m e[32;7m e[42;fg;1m
# yellow e[33m e[33;1m e[33;4m e[33;7m e[43;fg;1m
# blue e[34m e[34;1m e[34;4m e[34;7m e[44;fg;1m
# magenta e[35m e[35;1m e[35;4m e[35;7m e[45;fg;1m
# cyan e[36m e[36;1m e[36;4m e[36;7m e[46;fg;1m
# White e[37m e[37;1m e[37;4m e[37;7m e[47;fg;1m
#
# light black e[90m e[90;1m e[90;4m e[90;7m e[100;fg;1m
# light red e[91m e[91;1m e[91;4m e[91;7m e[101;fg;1m
# light green e[92m e[92;1m e[92;4m e[92;7m e[102;fg;1m
# light yellow e[93m e[93;1m e[93;4m e[93;7m e[103;fg;1m
# light blue e[94m e[94;1m e[94;4m e[94;7m e[104;fg;1m
# light magenta e[95m e[95;1m e[95;4m e[95;7m e[105;fg;1m
# light cyan e[96m e[96;1m e[96;4m e[96;7m e[106;fg;1m
# light White e[97m e[97;1m e[97;4m e[97;7m e[107;fg;1m
#
# Reset e[0m
infocmp $TERM
For the sake of learning, can you please tell me what these escape sequences are and how they tell VIM to do the right thing?
I'm wondering if it makes more sense to fix the termcap,
if that is needed, so that some other things which might ordinarily use color, might also. I understand that most command line tools don't. Some do. For example, the python shell is supposed to use color. manpages can use a little color in addition to bold on key words.
Just a few little things. Do you know what would be involved in fixing the underlying termcap database? I'm not afraid of root, but I've never understood how TERMCAP or TERMINFO work.
Am I to understand also that Terminal.app only supports xterm-color (8 colors)? Is that a limitation of Terminal or a limitation of the termcap that shipped with OSX?
Terminal.app might be closer to xterm than dtterm (aside from
the lack of the "bce" capability). In that case, a better place
to look for escape sequences would be in xterm's documentation,
e.g.,
http://invisible-island.net/xterm/ctlseqs/ctlseqs.html
ANSI Colorized Terminal?