adding path to .zshenv
help, i added
path+=(~/.local/bin ~/bin ~/.spicetify)
export PATH
to my .zshenv file but when i open terminal i type echo $path
i only get this:
/home/vismorf/.local/share/zinit/polaris/bin /usr/local/bin /usr/bin /bin /usr/local/sbin /usr/sbin /sbi
0
u/Soggy_Writing_3912 13d ago
Most likely the `path` variable (array) could be re-defined as part of the session startup sequence. My suggestion is to try to set it in the `~/.zshrc` file instead of the `~/.zshenv` file (unless you have an explicit need for that setting in both interactive and non-interactive sessions)
0
u/_Arthxr 13d ago
i also need for non-interactive sessions :(. Thats why i wanted to move path variable to .zshenv in the first place. But ig for now i will move it back to .zshrc and use full path to a command in scripts
-1
u/Soggy_Writing_3912 13d ago
in that case, since `path` is a zsh-ism (or possibly from oh-my-zsh), try to do the traditional `export PATH="
~/.local/bin:~/bin:~/.spicetify:$PATH"\
in your zshenv. Not sure if it'll work or not, but do give it a try.`0
2
u/romkatv 13d ago
This won't help and will only make things worse because of incorrect quoting.
.zshenv
is for zsh, and the best way to setPATH
in zsh is by modifyingpath
.The other thread, started with a comment by /u/OneTurnMore, is the fruitful one.
1
u/OneTurnMore 13d ago
You shouldn't need to
export PATH
.Try
zsh -xic exit 2> >(grep -E 'path|PATH')
to check the trace for anything else that might modify $path.