tui: Also use xterm-256color when TERM=screen and COLORTERM != NULL

When COLORTERM != null force xterm-256color capabilities when TERM equals xterm
or screen.
This commit is contained in:
Thiago de Arruda 2015-02-21 22:22:09 -03:00
parent 0ed3d66bef
commit 97f8251472

View File

@ -722,9 +722,10 @@ static void fix_terminfo(TUIData *data)
#define XTERM_SETAB \ #define XTERM_SETAB \
"\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m" "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m"
if (!strcmp(term, "xterm") && os_getenv("COLORTERM") != NULL) { if (os_getenv("COLORTERM") != NULL
&& (!strcmp(term, "xterm") || !strcmp(term, "screen"))) {
// probably every modern terminal that sets TERM=xterm supports 256 // probably every modern terminal that sets TERM=xterm supports 256
// colors(eg: gnome-terminal). // colors(eg: gnome-terminal). Also do it when TERM=screen.
unibi_set_num(ut, unibi_max_colors, 256); unibi_set_num(ut, unibi_max_colors, 256);
unibi_set_str(ut, unibi_set_a_foreground, XTERM_SETAF); unibi_set_str(ut, unibi_set_a_foreground, XTERM_SETAF);
unibi_set_str(ut, unibi_set_a_background, XTERM_SETAB); unibi_set_str(ut, unibi_set_a_background, XTERM_SETAB);