From 55819e6c861f53450030eea832a76583a6786370 Mon Sep 17 00:00:00 2001 From: Jörg Thalheim Date: Tue, 18 Feb 2020 13:30:02 +0000 Subject: Revert "zsh: don't clobber the environment of non-login shells" This reverts commit 6a756af3e7a50c22a45f7d958657527ac47d2902. 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 --- nixos/modules/programs/zsh/zsh.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'nixos/modules') diff --git a/nixos/modules/programs/zsh/zsh.nix b/nixos/modules/programs/zsh/zsh.nix index 4fbdba47b1df..930cc1987a33 100644 --- a/nixos/modules/programs/zsh/zsh.nix +++ b/nixos/modules/programs/zsh/zsh.nix @@ -162,9 +162,8 @@ in # This file is read for all shells. # 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 - export __ETC_ZSHENV_SOURCED=1 + __ETC_ZSHENV_SOURCED=1 if [ -z "$__NIXOS_SET_ENVIRONMENT_DONE" ]; then . ${config.system.build.setEnvironment} -- cgit 1.4.1