Skip to content

Commit

Permalink
Filter ANSI escape sequences in -L output
Browse files Browse the repository at this point in the history
Otherwise, builds like NixOS VM tests may leave the terminal in a
weird state and do resets.
  • Loading branch information
edolstra committed Oct 9, 2019
1 parent 55bba8e commit 4331eeb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nix/progress-bar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class ProgressBar : public Logger
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";
Expand Down

0 comments on commit 4331eeb

Please sign in to comment.