aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2012-10-31 11:49:20 -0400
committerWilliam Hubbs <w.d.hubbs@gmail.com>2013-01-04 08:48:08 -0600
commit3896b9d55ce76e41233eadb6d0ede2f8115736d3 (patch)
treed536c45bff0fc6253cb0e81cd89fc63997eb1547
parent630d23283aea2304396069c6a9c305913ccb02aa (diff)
libeinfo: check for "color" in the terminal name
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
-rw-r--r--src/libeinfo/libeinfo.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libeinfo/libeinfo.c b/src/libeinfo/libeinfo.c
index 98cec928..6f0ca766 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;
}