Hi again, This patch avoids out of bounds access.
--- terminal.c.orig 2022-04-24 13:57:34.231668500 +0200 +++ terminal.c 2022-04-24 14:34:35.798847083 +0200 @@ -24,8 +24,10 @@ mode = true; else if (var && !strcmp(var, "never")) mode = false; - else - mode = isatty(fileno(stdout)); + else { + var = getenv("TERM"); + mode = var && isatty(fileno(stdout)) && strstr(var, "color"); + } return mode; } Kind regards, Axel
--- terminal.c.orig 2022-04-24 13:57:34.231668500 +0200 +++ terminal.c 2022-04-24 14:34:35.798847083 +0200 @@ -24,8 +24,10 @@ mode = true; else if (var && !strcmp(var, "never")) mode = false; - else - mode = isatty(fileno(stdout)); + else { + var = getenv("TERM"); + mode = var && isatty(fileno(stdout)) && strstr(var, "color"); + } return mode; }