From 1c261c33bd3c0a03a3cecf81c2082d8d1904c772 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 8 Dec 2024 15:18:26 -0500 Subject: Respect $NO_COLOR for running programs --- stdlib/stdlib.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'stdlib/stdlib.c') 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); -- cgit v1.2.3