Hi,

Complaining doesn't help. I've created the following patch which fixes
the issue.

--- terminal.c.orig     2022-04-24 13:57:34.231668500 +0200
+++ terminal.c  2022-04-24 13:57:38.519643229 +0200
@@ -24,8 +24,11 @@
                mode = true;
        else if (var && !strcmp(var, "never"))
                mode = false;
-       else
-               mode = isatty(fileno(stdout));
+       else {
+               var = getenv("TERM");
+               mode = var && isatty(fileno(stdout)) &&
+                   strcmp(var + strlen(var) - 5, "color") == 0;
+       }
        return mode;
 }

It's also attached as a patch file.

Kind regards,
Axel
--- terminal.c.orig	2022-04-24 13:57:34.231668500 +0200
+++ terminal.c	2022-04-24 13:57:38.519643229 +0200
@@ -24,8 +24,11 @@
 		mode = true;
 	else if (var && !strcmp(var, "never"))
 		mode = false;
-	else
-		mode = isatty(fileno(stdout));
+	else {
+		var = getenv("TERM");
+		mode = var && isatty(fileno(stdout)) &&
+		    strcmp(var + strlen(var) - 5, "color") == 0;
+	}
 	return mode;
 }
 

Reply via email to