forked from lix-project/lix
Merge pull request #6674 from virusdave/dnicponski/scratch/dont_capture_stdout_in_nix_repl_master
Don't capture `stdout` when launching subshells in `nix repl`
This commit is contained in:
commit
3b18058969
|
@ -111,23 +111,20 @@ NixRepl::~NixRepl()
|
||||||
write_history(historyFile.c_str());
|
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 = {})
|
const std::optional<std::string> & input = {})
|
||||||
{
|
{
|
||||||
auto subprocessEnv = getEnv();
|
auto subprocessEnv = getEnv();
|
||||||
subprocessEnv["NIX_CONFIG"] = globalConfig.toKeyValue();
|
subprocessEnv["NIX_CONFIG"] = globalConfig.toKeyValue();
|
||||||
|
|
||||||
auto res = runProgram(RunOptions {
|
runProgram2(RunOptions {
|
||||||
.program = settings.nixBinDir+ "/" + program,
|
.program = settings.nixBinDir+ "/" + program,
|
||||||
.args = args,
|
.args = args,
|
||||||
.environment = subprocessEnv,
|
.environment = subprocessEnv,
|
||||||
.input = input,
|
.input = input,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!statusOk(res.first))
|
return;
|
||||||
throw ExecError(res.first, "program '%1%' %2%", program, statusToString(res.first));
|
|
||||||
|
|
||||||
return res.second;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static NixRepl * curRepl; // ugly
|
static NixRepl * curRepl; // ugly
|
||||||
|
|
Loading…
Reference in a new issue