aboutsummaryrefslogtreecommitdiff
path: root/src/libmain/progress-bar.cc
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2020-08-10 17:44:17 +0200
committerMaximilian Bosch <maximilian@mbosch.me>2020-08-10 17:44:17 +0200
commit5f8ae16c8b08485e7625283ccafb99727cd47693 (patch)
tree7355897b481639004eeb3041cb2ba1722272b340 /src/libmain/progress-bar.cc
parentedfd676e059578fb574ce78d1a2cc66d018d3b16 (diff)
Always reset ANSI colors in progress-bar line
When having a message like `waiting for a machine to build X` and building with `nix build -L`, the log-prefix is always colored yellow[1] on a small terminal-width as everything (including the ANSI color-reset) is stripped away. To work around that problem, this patch explicitly adds an `ANSI_NORMAL` to the end of the line. [1] https://imgur.com/a/FjtJOk3
Diffstat (limited to 'src/libmain/progress-bar.cc')
-rw-r--r--src/libmain/progress-bar.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libmain/progress-bar.cc b/src/libmain/progress-bar.cc
index 3f7d99a1d..be3c06a38 100644
--- a/src/libmain/progress-bar.cc
+++ b/src/libmain/progress-bar.cc
@@ -362,7 +362,7 @@ public:
auto width = getWindowSize().second;
if (width <= 0) width = std::numeric_limits<decltype(width)>::max();
- writeToStderr("\r" + filterANSIEscapes(line, false, width) + "\e[K");
+ writeToStderr("\r" + filterANSIEscapes(line, false, width) + ANSI_NORMAL + "\e[K");
}
std::string getStatus(State & state)