mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-25 23:36:16 +02:00
Add $NO_COLOR check to ANSI escape conditions
This commit is contained in:
parent
20cce079f2
commit
0fe84bef72
1 changed files with 3 additions and 1 deletions
|
@ -1374,7 +1374,9 @@ void ignoreException()
|
|||
|
||||
bool shouldANSI()
|
||||
{
|
||||
return isatty(STDERR_FILENO) && getEnv("TERM").value_or("dumb") != "dumb";
|
||||
return isatty(STDERR_FILENO)
|
||||
&& getEnv("TERM").value_or("dumb") != "dumb"
|
||||
&& !getEnv("NO_COLOR").has_value();
|
||||
}
|
||||
|
||||
std::string filterANSIEscapes(const std::string & s, bool filterAll, unsigned int width)
|
||||
|
|
Loading…
Reference in a new issue