diff options
| author | Julian Andres Klode <julian.klode@canonical.com> | 2021-10-19 15:31:22 +0200 |
|---|---|---|
| committer | Julian Andres Klode <julian.klode@canonical.com> | 2021-10-19 15:38:22 +0200 |
| commit | 400a6895566b67d70bcde43dc8a1cc1c7121f87d (patch) | |
| tree | c3c1439b0e5af8f956556eca7f64e2f3214e6e40 /apt-private/private-output.cc | |
| parent | bdc8526819d288f6076e1d1854138f139f2df32f (diff) | |
Respect NO_COLOR environment variable
When color has not been turned on explictly in the configuration
file or options, only turn it on if NO_COLOR is not set.
Diffstat (limited to 'apt-private/private-output.cc')
| -rw-r--r-- | apt-private/private-output.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/apt-private/private-output.cc b/apt-private/private-output.cc index d07ecc0ce..daa6c6aed 100644 --- a/apt-private/private-output.cc +++ b/apt-private/private-output.cc @@ -86,7 +86,7 @@ bool InitOutput(std::basic_streambuf<char> * const out) /*{{{*/ SigWinch(0); } - if(!isatty(1)) + if(!isatty(1) || getenv("NO_COLOR") != nullptr) { _config->Set("APT::Color", "false"); _config->Set("APT::Color::Highlight", ""); |
