aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd/repl.cc
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-04-05 22:22:44 +0200
committereldritch horrors <pennae@lix.systems>2024-07-05 22:28:16 +0000
commitb6a08a2fed8a48d3759ea67e958c9f9ec5f44d94 (patch)
tree7cfdefa2d8c354a77f9d8977ad33efbc1766ed33 /src/libcmd/repl.cc
parentf4f6d1d8e24a092422fcec601e21683179b735c9 (diff)
libutil: return a program handle from runProgram2
this will let us also return a source for the program output later, which will in turn make sinkToSource unnecessary for program output processing. this may also reopen a path for provigin program input, but that still needs a proper async io framework to avoid problems. Change-Id: Iaf93f47db99c38cfaf134bd60ed6a804d7ddf688
Diffstat (limited to 'src/libcmd/repl.cc')
-rw-r--r--src/libcmd/repl.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcmd/repl.cc b/src/libcmd/repl.cc
index 39e89d999..bb9225ce5 100644
--- a/src/libcmd/repl.cc
+++ b/src/libcmd/repl.cc
@@ -251,7 +251,7 @@ void runNix(Path program, const Strings & args)
.program = settings.nixBinDir+ "/" + program,
.args = args,
.environment = subprocessEnv,
- });
+ }).wait();
return;
}
@@ -650,7 +650,7 @@ ProcessLineResult NixRepl::processLine(std::string line)
// runProgram redirects stdout to a StringSink,
// using runProgram2 to allow editors to display their UI
- runProgram2(RunOptions { .program = editor, .searchPath = true, .args = args });
+ runProgram2(RunOptions { .program = editor, .searchPath = true, .args = args }).wait();
// Reload right after exiting the editor
state->resetFileCache();