Skip to content

Commit

Permalink
nix repl: Stop the progress bar
Browse files Browse the repository at this point in the history
The repl was broken since c3769c6. In
general, the progress bar is incompatible with the repl.
  • Loading branch information
edolstra committed Aug 22, 2022
1 parent 9ddef9f commit 0d2163c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/libcmd/repl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand All @@ -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();
}
Expand Down

0 comments on commit 0d2163c

Please sign in to comment.