aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-11-18 11:46:44 +0100
committerGitHub <noreply@github.com>2021-11-18 11:46:44 +0100
commit205655e98b88c501a889479b083913b159a6981e (patch)
tree9c5216974fa5c7589cc8a508d4fae33a951b41b7
parent1d0c6a4b99d0a9d7307262a9b4f3518de895138c (diff)
parent9653858ce68a04e2c23dbf14e344d4dca4bf7e24 (diff)
Merge pull request #5586 from tweag/fix-stdout-for-editors-in-repl
Fix :e in repl
-rw-r--r--src/nix/repl.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nix/repl.cc b/src/nix/repl.cc
index 4f13ee05d..fd86174f2 100644
--- a/src/nix/repl.cc
+++ b/src/nix/repl.cc
@@ -471,7 +471,10 @@ bool NixRepl::processLine(string line)
auto args = editorFor(pos);
auto editor = args.front();
args.pop_front();
- runProgram(editor, true, args);
+
+ // runProgram redirects stdout to a StringSink,
+ // using runProgram2 to allow editors to display their UI
+ runProgram2(RunOptions { .program = editor, .searchPath = true, .args = args });
// Reload right after exiting the editor
state->resetFileCache();