Revert "zsh: don't clobber the environment of non-login shells"
This reverts commit 6a756af3e7.
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
This commit is contained in:
@@ -162,9 +162,8 @@ in
|
|||||||
# This file is read for all shells.
|
# This file is read for all shells.
|
||||||
|
|
||||||
# Only execute this file once per shell.
|
# Only execute this file once per shell.
|
||||||
# But don't clobber the environment of interactive non-login children!
|
|
||||||
if [ -n "$__ETC_ZSHENV_SOURCED" ]; then return; fi
|
if [ -n "$__ETC_ZSHENV_SOURCED" ]; then return; fi
|
||||||
export __ETC_ZSHENV_SOURCED=1
|
__ETC_ZSHENV_SOURCED=1
|
||||||
|
|
||||||
if [ -z "$__NIXOS_SET_ENVIRONMENT_DONE" ]; then
|
if [ -z "$__NIXOS_SET_ENVIRONMENT_DONE" ]; then
|
||||||
. ${config.system.build.setEnvironment}
|
. ${config.system.build.setEnvironment}
|
||||||
|
|||||||
Reference in New Issue
Block a user