From def0f255c5e8ece8e0a942b8a16e68c6805879e3 Mon Sep 17 00:00:00 2001 From: fudian Date: Fri, 18 Sep 2026 17:06:03 +0800 Subject: [PATCH] fix(cli): re-resolve zsh at exec time to avoid a stale command hash (#14104) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 付典 --- lib/cli.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/cli.zsh b/lib/cli.zsh index 48fa8995b..c713db5d7 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -739,8 +739,8 @@ function _omz::reload { # Old zsh versions don't have ZSH_ARGZERO local zsh="${ZSH_ARGZERO:-${functrace[-1]%:*}}" # ZSH_ARGZERO is how zsh was invoked, not the path to it, so re-resolve - # anything that is not absolute (see #13919) - [[ "${zsh#-}" != /* ]] && (( $+commands[zsh] )) && zsh="$commands[zsh]" + # anything that is not absolute via $PATH at exec time (see #13919) + [[ "${zsh#-}" != /* ]] && (( $+commands[zsh] )) && zsh="zsh" # Check whether to run a login shell [[ "$zsh" = -* || -o login ]] && exec -l "${zsh#-}" || exec "$zsh" } @@ -923,8 +923,8 @@ function _omz::update { # Old zsh versions don't have ZSH_ARGZERO local zsh="${ZSH_ARGZERO:-${functrace[-1]%:*}}" # ZSH_ARGZERO is how zsh was invoked, not the path to it, so re-resolve - # anything that is not absolute (see #13919) - [[ "${zsh#-}" != /* ]] && (( $+commands[zsh] )) && zsh="$commands[zsh]" + # anything that is not absolute via $PATH at exec time (see #13919) + [[ "${zsh#-}" != /* ]] && (( $+commands[zsh] )) && zsh="zsh" # Check whether to run a login shell [[ "$zsh" = -* || -o login ]] && exec -l "${zsh#-}" || exec "$zsh" fi