Commit cfb86cd0 authored by Marc Cornellà's avatar Marc Cornellà
Browse files

zsh_reload: use $SHELL to reload zsh only if it's a zsh shell (fixes #9054)

parent cd17aed9
...@@ -7,6 +7,16 @@ src() { ...@@ -7,6 +7,16 @@ src() {
zrecompile -p $f && command rm -f $f.zwc.old zrecompile -p $f && command rm -f $f.zwc.old
done done
# Use $SHELL if available; remove leading dash if login shell # Use $SHELL if it's available and a zsh shell
[[ -n "$SHELL" ]] && exec ${SHELL#-} || exec zsh local shell="$ZSH_ARGZERO"
if [[ "${${SHELL:t}#-}" = zsh ]]; then
shell="$SHELL"
fi
# Remove leading dash if login shell and run accordingly
if [[ "${shell:0:1}" = "-" ]]; then
exec -l "${shell#-}"
else
exec "$shell"
fi
} }
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