Merge pull request #9056 from aakropotkin/patch-1

Respect `NOCOLOR`

(cherry picked from commit 4b78a66bc5066fab46b4c84a5b85c3839e9d8aab)
Change-Id: I005a13dea6cb33133f7bc59926cbaf5cf51c561a
This commit is contained in:
eldritch horrors 2024-03-04 03:47:11 +01:00
parent f17e7b1855
commit 8867479b27

View file

@ -1515,7 +1515,7 @@ bool shouldANSI()
{
return isatty(STDERR_FILENO)
&& getEnv("TERM").value_or("dumb") != "dumb"
&& !getEnv("NO_COLOR").has_value();
&& !(getEnv("NO_COLOR").has_value() || getEnv("NOCOLOR").has_value());
}
std::string filterANSIEscapes(std::string_view s, bool filterAll, unsigned int width)