From 3896b9d55ce76e41233eadb6d0ede2f8115736d3 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Wed, 31 Oct 2012 11:49:20 -0400 Subject: libeinfo: check for "color" in the terminal name Signed-off-by: Andrew Gregory --- src/libeinfo/libeinfo.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/libeinfo/libeinfo.c b/src/libeinfo/libeinfo.c index 98cec92..6f0ca76 100644 --- a/src/libeinfo/libeinfo.c +++ b/src/libeinfo/libeinfo.c @@ -150,11 +150,11 @@ static bool term_is_cons25 = false; static char termcapbuf[2048]; static char tcapbuf[512]; #else -/* No curses support, so we hardcode a list of colour capable terms */ +/* No curses support, so we hardcode a list of colour capable terms + * Only terminals without "color" in the name need to be explicitly listed */ static const char *const color_terms[] = { "Eterm", "ansi", - "color-xterm", "con132x25", "con132x30", "con132x43", @@ -174,7 +174,6 @@ static const char *const color_terms[] = { "kterm", "linux", "linux-c", - "mach-color", "mlterm", "putty", "rxvt", @@ -189,8 +188,6 @@ static const char *const color_terms[] = { "vt220", "wsvt25", "xterm", - "xterm-256color", - "xterm-color", "xterm-debian", NULL }; @@ -402,7 +399,10 @@ colour_terminal(FILE * EINFO_RESTRICT f) * which is not available to us when we boot */ if (term_is_cons25 || strcmp(term, "wsvt25") == 0) { #else - while (color_terms[i]) { + if (strstr(term, "color")) + in_colour = 1; + + while (color_terms[i] && in_colour != 1) { if (strcmp(color_terms[i], term) == 0) { in_colour = 1; } -- cgit v1.2.3