From 3dd7d023f496d97bc9cb1a5fcf889acccfd4a711 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Wed, 26 Jun 2024 14:08:20 +0200 Subject: [PATCH] libmain: don't print empty lines this most notably affects `nix eval`: if there is no progress bar to be shown and no activities going on we should not print anything at all. a progress bar with no activities would print a bunch of terminal escapes *and a space*, which is not helpful in simple cases like nix eval -E 1. notably this does *not* affect nix eval called on non-terminal outputs, but it is slightly confusing nevertheless (and not difficult to avoid). fixes https://git.lix.systems/lix-project/lix/issues/424 Change-Id: Iee793c79ba5a485d6606e0d292ed2eae6dfb7216 --- src/libmain/progress-bar.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libmain/progress-bar.cc b/src/libmain/progress-bar.cc index e36bc0b01..68654c636 100644 --- a/src/libmain/progress-bar.cc +++ b/src/libmain/progress-bar.cc @@ -396,7 +396,7 @@ std::chrono::milliseconds ProgressBar::draw(State & state, const std::optional