Merge pull request #9056 from aakropotkin/patch-1

Respect `NOCOLOR`
This commit is contained in:
Robert Hensing 2023-09-27 22:29:09 +01:00 committed by GitHub
commit 4b78a66bc5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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)