[arch-general] Zsh, tmux, and paths
Hello, I've noticed that, if one modifies the PATH environment variable in .zshenv, tmux fails to notice this. That is, `echo $PATH` yields different results within and without tmux, with the former being the default path, and the latter the path as modified by .zshenv. When I update PATH in .zshrc, though, it is picked up fine by tmux. I don't know what to make of this, but I've noticed the following, which might be related. If I undertand it correctly, zhs: * First sources .zshenv * Then sources /etc/zsh/zprofile * Then .zshrc In the second step, /etc/zsh/zprofile sources /etc/profile, which changes the path back to the default. Might this be the reason why tmux picks .zshrc path changes up correctly, but not .zshenv path changes? Cheers, Manolo --
On Wed, Mar 13, 2013 at 4:31 PM, Manolo Martínez <manolo@austrohungaro.com> wrote:
Hello,
I've noticed that, if one modifies the PATH environment variable in .zshenv, tmux fails to notice this. That is, `echo $PATH` yields different results within and without tmux, with the former being the default path, and the latter the path as modified by .zshenv.
When I update PATH in .zshrc, though, it is picked up fine by tmux.
This should also happen when you log in a tty.
* First sources .zshenv * Then sources /etc/zsh/zprofile * Then .zshrc
In the second step, /etc/zsh/zprofile sources /etc/profile, which changes the path back to the default. Might this be the reason why tmux picks .zshrc path changes up correctly, but not .zshenv path changes?
It was reported [1] and documented in the wiki [2]. zprofile sources /etc/profile, which replaces your $PATH ignoring already existing settings. What I did was modify /etc/profile to include the value of PATH in the newly created variable: PATH="$PATH:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin" [1] https://bugs.archlinux.org/task/31873 [2] https://wiki.archlinux.org/index.php/Zsh#Configuration_files -- Ivan Sichmann Freitas GNU/Linux user #509059 SDF MetaArpa Member http://isf.sdf.org/about.html
On 03/13/13 at 09:46pm, Ivan S. Freitas wrote:
On Wed, Mar 13, 2013 at 4:31 PM, Manolo Martínez <manolo@austrohungaro.com> wrote:
Hello,
I've noticed that, if one modifies the PATH environment variable in .zshenv, tmux fails to notice this. That is, `echo $PATH` yields different results within and without tmux, with the former being the default path, and the latter the path as modified by .zshenv.
When I update PATH in .zshrc, though, it is picked up fine by tmux.
This should also happen when you log in a tty.
* First sources .zshenv * Then sources /etc/zsh/zprofile * Then .zshrc
In the second step, /etc/zsh/zprofile sources /etc/profile, which changes the path back to the default. Might this be the reason why tmux picks .zshrc path changes up correctly, but not .zshenv path changes?
It was reported [1] and documented in the wiki [2]. zprofile sources /etc/profile, which replaces your $PATH ignoring already existing settings. What I did was modify /etc/profile to include the value of PATH in the newly created variable: PATH="$PATH:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"
[1] https://bugs.archlinux.org/task/31873 [2] https://wiki.archlinux.org/index.php/Zsh#Configuration_files
I had read the wiki, but before my path woes, and failed to put two and two together. Thanks for the info. If I may ask, what's the rationale for overwriting the path? Cheers, Manolo
On Thursday 14 Mar 2013 08:25:35 Manolo Martínez wrote:
I had read the wiki, but before my path woes, and failed to put two and two together. Thanks for the info. If I may ask, what's the rationale for overwriting the path?
I suspect this is because the intention is for a login session to be clean and predictable, so you don't want to inherit much environment from the parent process. Paul
participants (3)
-
Ivan S. Freitas
-
Manolo Martínez
-
Paul Gideon Dann