Don't capture stdout when launching subshells in nix repl

This commit is contained in:
Dave Nicponski 2022-06-15 12:49:12 -04:00
parent 9f58df4c91
commit c6f7726f48

View file

@ -111,23 +111,20 @@ NixRepl::~NixRepl()
write_history(historyFile.c_str());
}
std::string runNix(Path program, const Strings & args,
void runNix(Path program, const Strings & args,
const std::optional<std::string> & input = {})
{
auto subprocessEnv = getEnv();
subprocessEnv["NIX_CONFIG"] = globalConfig.toKeyValue();
auto res = runProgram(RunOptions {
runProgram2(RunOptions {
.program = settings.nixBinDir+ "/" + program,
.args = args,
.environment = subprocessEnv,
.input = input,
});
if (!statusOk(res.first))
throw ExecError(res.first, "program '%1%' %2%", program, statusToString(res.first));
return res.second;
return;
}
static NixRepl * curRepl; // ugly