mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-19 21:41:07 +01:00
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`.
This commit is contained in:
parent
8706c8eb64
commit
405b8f220a
1 changed files with 2 additions and 1 deletions
|
@ -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 a new issue