diff --git a/src/libcmd/repl.cc b/src/libcmd/repl.cc index 49865aa90..7269bdba5 100644 --- a/src/libcmd/repl.cc +++ b/src/libcmd/repl.cc @@ -622,7 +622,7 @@ ProcessLineResult NixRepl::processLine(std::string line) // TODO: this only shows a progress bar for explicitly initiated builds, // not eval-time fetching or builds performed for IFD. // But we can't just show it everywhere, since that would erase partial output from evaluation. - startProgressBar(); + logger->resume(); Finally stopLogger([&]() { stopProgressBar(); }); diff --git a/src/libmain/progress-bar.cc b/src/libmain/progress-bar.cc index d83b09cd4..5d28db5f2 100644 --- a/src/libmain/progress-bar.cc +++ b/src/libmain/progress-bar.cc @@ -112,6 +112,8 @@ public: ~ProgressBar() { stop(); + quitCV.notify_one(); + updateThread.join(); } /* Called by destructor, can't be overridden */ @@ -123,9 +125,7 @@ public: state->active = false; writeToStderr("\r\e[K"); updateCV.notify_one(); - quitCV.notify_one(); } - updateThread.join(); } void pause() override { @@ -135,6 +135,7 @@ public: void resume() override { state_.lock()->paused = false; + state_.lock()->active = isTTY; writeToStderr("\r\e[K"); state_.lock()->haveUpdate = true; updateCV.notify_one();