Merge pull request #4168 from mkenigs/fix-3975

Make bash non-interactive for nix develop --phase
This commit is contained in:
Eelco Dolstra 2020-10-20 19:15:32 +02:00 committed by GitHub
commit 21244e1062
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -368,7 +368,6 @@ struct CmdDevelop : Common, MixEnvironment
// rid of that.
script += fmt("foundMakefile=1\n");
script += fmt("runHook %1%Phase\n", *phase);
script += fmt("exit 0\n", *phase);
}
else if (!command.empty()) {
@ -408,7 +407,10 @@ struct CmdDevelop : Common, MixEnvironment
ignoreException();
}
auto args = Strings{std::string(baseNameOf(shell)), "--rcfile", rcFilePath};
// If running a phase, don't want an interactive shell running after
// Ctrl-C, so don't pass --rcfile
auto args = phase ? Strings{std::string(baseNameOf(shell)), rcFilePath}
: Strings{std::string(baseNameOf(shell)), "--rcfile", rcFilePath};
restoreAffinity();
restoreSignals();