mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
Merge pull request #1275 from steveeJ/patch-1
nix-shell/pure: keep environment variable SHLVL
This commit is contained in:
commit
dc931fe1cd
1 changed files with 1 additions and 1 deletions
|
@ -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