aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-12-08 15:18:26 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-12-08 15:18:26 -0500
commit1c261c33bd3c0a03a3cecf81c2082d8d1904c772 (patch)
tree6de92ce6e664ee1c213b55023f1371fc6e821c7a /stdlib
parentd65a0abba13a041fa07851b4db222336fab1d954 (diff)
Respect $NO_COLOR for running programs
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/stdlib.c2
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);