Skip to content

Commit

Permalink
Revert "Merge pull request NixOS#9476 from alois31/restore-progress-bar"
Browse files Browse the repository at this point in the history
Observed to regress nix repl attrset printing with narrow windows.

This reverts commit a2d5e80.

Fixes: https://git.lix.systems/lix-project/lix/issues/168

Change-Id: I8e0031475b4ec26d6a71014357d973578b70815c
  • Loading branch information
lf- committed Mar 24, 2024
1 parent 652f52f commit 946fc12
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/libcmd/repl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "local-fs-store.hh"
#include "signals.hh"
#include "print.hh"
#include "progress-bar.hh"

#if HAVE_BOEHMGC
#define GC_INCLUDE_NEW
Expand Down Expand Up @@ -195,11 +196,13 @@ ReplExitStatus NixRepl::mainLoop()

auto _guard = interacter->init(static_cast<detail::ReplCompleterMixin *>(this));

/* 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 (!interacter->getLine(input, input.empty() ? ReplPromptType::ReplPrompt : ReplPromptType::ContinuationPrompt)) {
Expand All @@ -210,7 +213,6 @@ ReplExitStatus NixRepl::mainLoop()
// the entire program?
return ReplExitStatus::QuitAll;
}
logger->resume();
try {
switch (processLine(input)) {
case ProcessLineResult::Quit:
Expand Down

0 comments on commit 946fc12

Please sign in to comment.