summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-private/private-cmndline.cc4
-rw-r--r--apt-private/private-output.cc2
2 files changed, 3 insertions, 3 deletions
diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc
index 3d6816d57..9b84f2dd5 100644
--- a/apt-private/private-cmndline.cc
+++ b/apt-private/private-cmndline.cc
@@ -487,8 +487,8 @@ static void BinarySpecificConfiguration(char const * const Binary) /*{{{*/
}
if (binary == "apt" || binary == "apt-config")
{
- if (getenv("NO_COLOR") == nullptr)
- _config->CndSet("Binary::apt::APT::Color", true);
+ if (getenv("NO_COLOR") == nullptr && getenv("APT_NO_COLOR") == nullptr)
+ _config->CndSet("Binary::apt::APT::Color", true);
_config->CndSet("Binary::apt::APT::Output-Version", 30);
_config->CndSet("Binary::apt::APT::Cache::Show::Version", 2);
_config->CndSet("Binary::apt::APT::Cache::AllVersions", false);
diff --git a/apt-private/private-output.cc b/apt-private/private-output.cc
index 95dc740cc..522fba4c6 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(STDOUT_FILENO) == 0 || not _config->FindB("APT::Color", true) || getenv("NO_COLOR") != nullptr)
+ if (isatty(STDOUT_FILENO) == 0 || not _config->FindB("APT::Color", true) || getenv("NO_COLOR") != nullptr || getenv("APT_NO_COLOR") != nullptr)
{
_config->Set("APT::Color", false);
_config->Set("APT::Color::Highlight", "");