mirror of https://github.com/ohmyzsh/ohmyzsh.git
zsh_reload: use `exec zsh` instead of `source ~/.zshrc`
`source ~/.zshrc` is a bad practice, it doesn't make sure that the full zsh session is reloaded and it may have side effects. Use `$SHELL` as the path to zsh if it exists (this will fix edge cases where the zsh used is not the first on $PATH). Otherwise, use `zsh`.pull/5601/head
parent
8706c8eb64
commit
405b8f220a
|
@ -7,5 +7,6 @@ src() {
|
||||||
zrecompile -p $f && command rm -f $f.zwc.old
|
zrecompile -p $f && command rm -f $f.zwc.old
|
||||||
done
|
done
|
||||||
|
|
||||||
source ~/.zshrc
|
# Use $SHELL if available; remove leading dash if login shell
|
||||||
|
[[ -n "$SHELL" ]] && exec ${SHELL#-} || exec zsh
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue