Detect OS X broken /etc/zshenv
and suggest rename
If `/etc/zshenv` that calls `path_helper` is found on the system, assume OS X version pre-El Capitan and suggest that this file gets renamed to `zprofile` so that it only gets sourced on login shells and doesn't mess up PATH order on nested invocation of zsh.
This commit is contained in:
parent
ed8619e0ab
commit
5d397e6fa5
1 changed files with 13 additions and 0 deletions
13
zshrc
13
zshrc
|
@ -111,5 +111,18 @@ _load_settings() {
|
|||
}
|
||||
_load_settings "$HOME/.zsh/configs"
|
||||
|
||||
# detect old OS X broken /etc/zshenv and suggest rename
|
||||
if grep -qw path_helper /etc/zshenv 2>/dev/null; then
|
||||
cat <<MSG >&2
|
||||
${fg[red]}Warning:${reset_color} \`/etc/zshenv' configuration file on your system may cause unexpected
|
||||
PATH changes on subsequent invocations of the zsh shell. The solution is to
|
||||
rename the file to \`zprofile':
|
||||
${fg_bold[white]}sudo mv /etc/{zshenv,zprofile}${reset_color}
|
||||
|
||||
(called from ${(%):-%N:%i})
|
||||
|
||||
MSG
|
||||
fi
|
||||
|
||||
# Local config
|
||||
[[ -f ~/.zshrc.local ]] && source ~/.zshrc.local
|
||||
|
|
Loading…
Add table
Reference in a new issue