aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-08-22 14:27:36 +0200
committerEelco Dolstra <edolstra@gmail.com>2022-08-22 14:27:36 +0200
commit0d2163c6dcf03463fa91ec6d0d96c928ad907366 (patch)
tree9262feb1cffeb5cabcce5821ec9c394b6bdd9e0b /src/libcmd
parent9ddef9f0be811277c76c1c2bd126cac7de4eaa35 (diff)
nix repl: Stop the progress bar
The repl was broken since c3769c68465bae971ab6bb48cfcdea85b61ea83a. In general, the progress bar is incompatible with the repl.
Diffstat (limited to 'src/libcmd')
-rw-r--r--src/libcmd/repl.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/libcmd/repl.cc b/src/libcmd/repl.cc
index 23df40337..150bd42ac 100644
--- a/src/libcmd/repl.cc
+++ b/src/libcmd/repl.cc
@@ -35,6 +35,7 @@ extern "C" {
#include "finally.hh"
#include "markdown.hh"
#include "local-fs-store.hh"
+#include "progress-bar.hh"
#if HAVE_BOEHMGC
#define GC_INCLUDE_NEW
@@ -252,6 +253,10 @@ 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) {
@@ -1037,9 +1042,10 @@ void runRepl(
struct CmdRepl : InstallablesCommand
{
- CmdRepl(){
+ CmdRepl() {
evalSettings.pureEval = false;
}
+
void prepare()
{
if (!settings.isExperimentalFeatureEnabled(Xp::ReplFlake) && !(file) && this->_installables.size() >= 1) {
@@ -1053,12 +1059,15 @@ struct CmdRepl : InstallablesCommand
}
installables = InstallablesCommand::load();
}
+
std::vector<std::string> files;
+
Strings getDefaultFlakeAttrPaths() override
{
return {""};
}
- virtual bool useDefaultInstallables() override
+
+ bool useDefaultInstallables() override
{
return file.has_value() or expr.has_value();
}