about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-10-09T21·25+0200
committerEelco Dolstra <edolstra@gmail.com>2019-10-09T21·57+0200
commit910b0fcc118cce3ade09f252da43fbe2436080e5 (patch)
tree7b3ed49ba74acf9ace4dc6da8523776b3128a2c4
parente232bf2b6993e1fcb551b35c76ca879634228de3 (diff)
Filter ANSI escape sequences in -L output
Otherwise, builds like NixOS VM tests may leave the terminal in a
weird state and do resets.

(cherry picked from commit 4331eeb13d241dfe2d2e6a01c53915c556cac94f)
-rw-r--r--src/nix/progress-bar.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nix/progress-bar.cc b/src/nix/progress-bar.cc
index c0bcfb0c91bc..5c05d6b227ed 100644
--- a/src/nix/progress-bar.cc
+++ b/src/nix/progress-bar.cc
@@ -120,7 +120,7 @@ public:
     void log(State & state, Verbosity lvl, const std::string & s)
     {
         if (state.active) {
-            writeToStderr("\r\e[K" + s + ANSI_NORMAL "\n");
+            writeToStderr("\r\e[K" + filterANSIEscapes(s, !isTTY) + ANSI_NORMAL "\n");
             draw(state);
         } else {
             auto s2 = s + ANSI_NORMAL "\n";