diff options
author | Marc Cornellà <hello@mcornella.com> | 2022-01-21 19:03:35 +0100 |
---|---|---|
committer | Marc Cornellà <hello@mcornella.com> | 2022-01-22 22:07:09 +0100 |
commit | 84931adcd465e9a3b5e38f3b416a1df2acc33801 (patch) | |
tree | b0eb1d7a9dc6ec8ac42b52a1d68a9c458ec9ccef /lib | |
parent | 4e0f19cf923163104d86308d2366d37da35c0622 (diff) | |
download | zsh-84931adcd465e9a3b5e38f3b416a1df2acc33801.tar.gz zsh-84931adcd465e9a3b5e38f3b416a1df2acc33801.tar.bz2 zsh-84931adcd465e9a3b5e38f3b416a1df2acc33801.zip |
fix: do not call chpwd hooks in subshells
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cli.zsh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/cli.zsh b/lib/cli.zsh index 70076bcfb..2f3f293da 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -37,7 +37,7 @@ function _omz { elif (( CURRENT == 3 )); then case "$words[2]" in changelog) local -a refs - refs=("${(@f)$(cd "$ZSH"; command git for-each-ref --format="%(refname:short):%(subject)" refs/heads refs/tags)}") + refs=("${(@f)$(builtin cd -q "$ZSH"; command git for-each-ref --format="%(refname:short):%(subject)" refs/heads refs/tags)}") _describe 'command' refs ;; plugin) subcmds=( 'disable:Disable plugin(s)' @@ -176,7 +176,7 @@ function _omz::changelog { local version=${1:-HEAD} format=${3:-"--text"} if ( - cd "$ZSH" + builtin cd -q "$ZSH" ! command git show-ref --verify refs/heads/$version && \ ! command git show-ref --verify refs/tags/$version && \ ! command git rev-parse --verify "${version}^{commit}" @@ -761,7 +761,7 @@ function _omz::theme::use { } function _omz::update { - local last_commit=$(cd "$ZSH"; git rev-parse HEAD) + local last_commit=$(builtin cd -q "$ZSH"; git rev-parse HEAD) # Run update script if [[ "$1" != --unattended ]]; then @@ -777,7 +777,7 @@ function _omz::update { command rm -rf "$ZSH/log/update.lock" # Restart the zsh session if there were changes - if [[ "$1" != --unattended && "$(cd "$ZSH"; git rev-parse HEAD)" != "$last_commit" ]]; then + if [[ "$1" != --unattended && "$(builtin cd -q "$ZSH"; git rev-parse HEAD)" != "$last_commit" ]]; then # Old zsh versions don't have ZSH_ARGZERO local zsh="${ZSH_ARGZERO:-${functrace[-1]%:*}}" # Check whether to run a login shell @@ -787,7 +787,7 @@ function _omz::update { function _omz::version { ( - cd "$ZSH" + builtin cd -q "$ZSH" # Get the version name: # 1) try tag-like version |