forked from lix-project/lix
Respect NOCOLOR
While `nix` has always been respectful towards requests for `NO_COLOR=1`, this change asks represents a new stage of maturity for `nix` - making it also respect quests for `NOCOLOR=1`. This ideally makes the tool more accessible to folks like me, who are exhausted by guessing whether `NO_COLOR` or `NOCOLOR` is the right environment variable to set. <3
This commit is contained in:
parent
57eb62d230
commit
5bc540a8ca
|
@ -1515,7 +1515,7 @@ bool shouldANSI()
|
||||||
{
|
{
|
||||||
return isatty(STDERR_FILENO)
|
return isatty(STDERR_FILENO)
|
||||||
&& getEnv("TERM").value_or("dumb") != "dumb"
|
&& 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)
|
std::string filterANSIEscapes(std::string_view s, bool filterAll, unsigned int width)
|
||||||
|
|
Loading…
Reference in a new issue