If you check out https://zsh.sourceforge.io/Guide/zshguide02.html#l24, a neat trick to set up your PATH variable is:
typeset -U path
path=(~/bin ~/progs/bin $path)
.
I was editing my .zprofile from
typeset -U path
path=(
$path
)
to
typeset -U path
path=(
"${path}"
)
when I suddenly got some really bizarre errors, such as
/etc/zshrc:7: command not found: locale
on startup and
prompt_status:9: file name too long: wc
every time I used a command, and a lot of built-in commands weren't working.
I figured out that the reason is that "${var}" !== $var if var is an array. The code you actually want if you want is:
typeset -U path
path=(
"${HOME}/.local/bin"
"${path[@]}"
)