[arch-general] Zsh, tmux, and paths

Ivan S. Freitas ivansichfreitas at gmail.com
Wed Mar 13 20:46:04 EDT 2013


On Wed, Mar 13, 2013 at 4:31 PM, Manolo Martínez
<manolo at 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


More information about the arch-general mailing list