Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Oh My Zsh
Commits
cfb86cd0
Commit
cfb86cd0
authored
Aug 24, 2020
by
Marc Cornellà
Browse files
zsh_reload: use $SHELL to reload zsh only if it's a zsh shell (fixes #9054)
parent
cd17aed9
Changes
1
Hide whitespace changes
Inline
Side-by-side
plugins/zsh_reload/zsh_reload.plugin.zsh
View file @
cfb86cd0
...
...
@@ -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
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment