forked from lix-project/lix
nix-shell/pure: keep environment variable SHLVL
This commit is contained in:
parent
ae568847f5
commit
f628ca2a1f
|
@ -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