Add $NO_COLOR check to ANSI escape conditions

This commit is contained in:
Yestin L. Harrison 2021-07-02 09:33:54 -06:00
parent 20cce079f2
commit 0fe84bef72

View file

@ -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)