mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-19 20:29:45 +01:00
zsh_reload: use $SHELL to reload zsh only if it's a zsh shell (fixes #9054)
This commit is contained in:
parent
cd17aed9e1
commit
cfb86cd08d
1 changed files with 12 additions and 2 deletions
|
@ -7,6 +7,16 @@ src() {
|
|||
zrecompile -p $f && command rm -f $f.zwc.old
|
||||
done
|
||||
|
||||
# Use $SHELL if available; remove leading dash if login shell
|
||||
[[ -n "$SHELL" ]] && exec ${SHELL#-} || exec zsh
|
||||
# Use $SHELL if it's available and a zsh shell
|
||||
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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue