diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-12-08 15:18:26 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-12-08 15:18:26 -0500 |
| commit | 1c261c33bd3c0a03a3cecf81c2082d8d1904c772 (patch) | |
| tree | 6de92ce6e664ee1c213b55023f1371fc6e821c7a /stdlib/stdlib.c | |
| parent | d65a0abba13a041fa07851b4db222336fab1d954 (diff) | |
Respect $NO_COLOR for running programs
Diffstat (limited to 'stdlib/stdlib.c')
| -rw-r--r-- | stdlib/stdlib.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/stdlib/stdlib.c b/stdlib/stdlib.c index 569970c2..b4a1ad77 100644 --- a/stdlib/stdlib.c +++ b/stdlib/stdlib.c @@ -43,6 +43,8 @@ public void tomo_init(void) { GC_INIT(); USE_COLOR = getenv("COLOR") ? strcmp(getenv("COLOR"), "1") == 0 : isatty(STDOUT_FILENO); + if (getenv("NO_COLOR") && getenv("NO_COLOR")[0] != '\0') + USE_COLOR = false; getrandom(TOMO_HASH_KEY, sizeof(TOMO_HASH_KEY), 0); int rng_fd = open("/dev/urandom", O_RDONLY); |
