Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "zsh: don't clobber the environment of non-login shells" #80448

Merged
merged 1 commit into from Feb 18, 2020

Conversation

Mic92
Copy link
Member

@Mic92 Mic92 commented Feb 18, 2020

This reverts commit 6a756af.

Currently zshenv by default only set fpath and HELPDIR without exporting them.
A parent shell would also not set those variables usually as they are shell local.

It also sources a file called set-environment but this is protected by an
environment variable called __NIXOS_SET_ENVIRONMENT_DONE. Hence any modification
done by the parent shell should persist as long as __NIXOS_SET_ENVIRONMENT_DONE
is not unset.

This behavior deviates from what we do in bashrc and breaks common setups such
as tmux/mosh or screen.
Fixes #80437

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

This reverts commit 6a756af.

Currently zshenv by default only set fpath and HELPDIR without exporting them.
A parent shell would also not set those variables usually as they are shell local.

It also sources a file called set-environment but this is protected by an
environment variable called __NIXOS_SET_ENVIRONMENT_DONE. Hence any modification
done by the parent shell should persist as long as __NIXOS_SET_ENVIRONMENT_DONE
is not unset.

This behavior deviates from what we do in bashrc and breaks common setups such
as tmux/mosh or screen.

Fixes NixOS#80437
@FRidh FRidh requested a review from ttuegel February 18, 2020 17:28
@ttuegel ttuegel added the 9.needs: port to stable A PR needs a backport to the stable release. label Feb 18, 2020
@ttuegel ttuegel merged commit b3a47c6 into NixOS:master Feb 18, 2020
@Mic92 Mic92 deleted the zshenv branch February 19, 2020 08:59
@Mic92
Copy link
Member Author

Mic92 commented Feb 19, 2020

20.03:

[detached HEAD 6761014] Revert "zsh: don't clobber the environment of non-login shells"
Date: Tue Feb 18 13:30:02 2020 +0000
1 file changed, 1 insertion(+), 2 deletions(-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

zsh completion/fpath not set in mosh/tmux
2 participants