Merge pull request #1275 from steveeJ/patch-1
nix-shell/pure: keep environment variable SHLVL
This commit is contained in:
commit
dc931fe1cd
|
@ -394,7 +394,7 @@ int main(int argc, char ** argv)
|
||||||
auto tmp = getEnv("TMPDIR", getEnv("XDG_RUNTIME_DIR", "/tmp"));
|
auto tmp = getEnv("TMPDIR", getEnv("XDG_RUNTIME_DIR", "/tmp"));
|
||||||
|
|
||||||
if (pure) {
|
if (pure) {
|
||||||
std::set<string> keepVars{"HOME", "USER", "LOGNAME", "DISPLAY", "PATH", "TERM", "IN_NIX_SHELL", "TZ", "PAGER", "NIX_BUILD_SHELL"};
|
std::set<string> keepVars{"HOME", "USER", "LOGNAME", "DISPLAY", "PATH", "TERM", "IN_NIX_SHELL", "TZ", "PAGER", "NIX_BUILD_SHELL", "SHLVL"};
|
||||||
decltype(env) newEnv;
|
decltype(env) newEnv;
|
||||||
for (auto & i : env)
|
for (auto & i : env)
|
||||||
if (keepVars.count(i.first))
|
if (keepVars.count(i.first))
|
||||||
|
|
Loading…
Reference in a new issue