Commit 405b8f22 authored by Marc Cornellà's avatar Marc Cornellà
Browse files

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`.
parent 8706c8eb
......@@ -7,5 +7,6 @@ src() {
zrecompile -p $f && command rm -f $f.zwc.old
done
source ~/.zshrc
# Use $SHELL if available; remove leading dash if login shell
[[ -n "$SHELL" ]] && exec ${SHELL#-} || exec zsh
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment