Skip to content

Commit

Permalink
Support NO_COLOR environment variable, as per https://no-color.org
Browse files Browse the repository at this point in the history
  • Loading branch information
syzop committed Mar 11, 2023
1 parent e4571a5 commit c43753c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/misc.c
Expand Up @@ -2154,7 +2154,12 @@ int terminal_supports_color(void)
#ifndef _WIN32
char *s;

/* Yeah we check all of stdin, stdout, stderr, because
/* Support NO_COLOR as per https://no-color.org */
s = getenv("NO_COLOR");
if (s != NULL && s[0] != '\0')
return 0;

/* Yeah we check all of stdin, stdout, stderr, because one
* or more may be redirected (bin/unrealircd >log 2>&1),
* and then we want to say no to color support.
*/
Expand Down

0 comments on commit c43753c

Please sign in to comment.