about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-02-18T16·47+0100
committerEelco Dolstra <edolstra@gmail.com>2020-02-18T17·36+0100
commit2f0122b23cb0b9e15bcda81ef188190ada899b1a (patch)
treea37d1c130bdc2d30444a65928491823da58cbb4c
parentdb3d3a56184a34d7fa46f493e1ecd3ff0ff10453 (diff)
Disable the progress bar if $TERM == dumb or unset
Fixes #3363.

(cherry picked from commit d8fd31f50ff55f7f334a2b9e58a82570e82ec28d)
-rw-r--r--src/nix/progress-bar.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nix/progress-bar.cc b/src/nix/progress-bar.cc
index 661966733d36..28199c917fcd 100644
--- a/src/nix/progress-bar.cc
+++ b/src/nix/progress-bar.cc
@@ -439,7 +439,9 @@ public:
 
 void startProgressBar(bool printBuildLogs)
 {
-    logger = new ProgressBar(printBuildLogs, isatty(STDERR_FILENO));
+    logger = new ProgressBar(
+        printBuildLogs,
+        isatty(STDERR_FILENO) && getEnv("TERM").value_or("dumb") != "dumb");
 }
 
 void stopProgressBar()