Skip to content

Commit

Permalink
Merge pull request #10618 from srhb/editor-pause-repl
Browse files Browse the repository at this point in the history
nix repl: hide progress bar during :edit
  • Loading branch information
edolstra committed Apr 29, 2024
2 parents 2f67833 + e5f509e commit 4161f3c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libcmd/repl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,10 @@ ProcessLineResult NixRepl::processLine(std::string line)
auto editor = args.front();
args.pop_front();

// avoid garbling the editor with the progress bar
logger->pause();
Finally resume([&]() { logger->resume(); });

// runProgram redirects stdout to a StringSink,
// using runProgram2 to allow editors to display their UI
runProgram2(RunOptions { .program = editor, .lookupPath = true, .args = args });
Expand Down

0 comments on commit 4161f3c

Please sign in to comment.