diff --git a/src/nix-env/main.cc b/src/nix-env/main.cc index 6d542c9b6..f0493bb5e 100644 --- a/src/nix-env/main.cc +++ b/src/nix-env/main.cc @@ -13,6 +13,8 @@ #include #include +#include + typedef enum { srcNixExprDrvs, @@ -711,6 +713,7 @@ static VersionDiff compareVersionAgainstSet( static string colorString(const string & s) { + if (!isatty(STDOUT_FILENO)) return s; return "\e[1;31m" + s + "\e[0m"; }