diff options
author | eldritch horrors <pennae@lix.systems> | 2024-03-04 06:21:59 +0100 |
---|---|---|
committer | eldritch horrors <pennae@lix.systems> | 2024-03-04 07:11:25 +0100 |
commit | a2d5e803cf16e048f30f0334114759f81f6c5d20 (patch) | |
tree | 44a0d05008d89c2e40a22ea1382b60ac3164cdf9 | |
parent | 001be527944665433a149add979b9a8139787ee6 (diff) |
Merge pull request #9476 from alois31/restore-progress-bar
nix repl: Only hide the progress bar while waiting for user input
(cherry picked from commit 3bebaefcd0c5d650f7edcd39f397bb45c4382f41)
Change-Id: Ie7c0db46f7c2cf5f938e66bdd3c31f0b62bdb104
-rw-r--r-- | src/libcmd/repl.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/libcmd/repl.cc b/src/libcmd/repl.cc index 944609f22..9bd773f68 100644 --- a/src/libcmd/repl.cc +++ b/src/libcmd/repl.cc @@ -40,7 +40,6 @@ extern "C" { #include "finally.hh" #include "markdown.hh" #include "local-fs-store.hh" -#include "progress-bar.hh" #include "print.hh" #if HAVE_BOEHMGC @@ -259,13 +258,11 @@ void NixRepl::mainLoop() rl_set_list_possib_func(listPossibleCallback); #endif - /* Stop the progress bar because it interferes with the display of - the repl. */ - stopProgressBar(); - std::string input; while (true) { + // Hide the progress bar while waiting for user input, so that it won't interfere. + logger->pause(); // When continuing input from previous lines, don't print a prompt, just align to the same // number of chars as the prompt. if (!getLine(input, input.empty() ? "nix-repl> " : " ")) { @@ -275,6 +272,7 @@ void NixRepl::mainLoop() logger->cout(""); break; } + logger->resume(); try { if (!removeWhitespace(input).empty() && !processLine(input)) return; } catch (ParseError & e) { |