From 0f6836701d82a2ee024153c7f781bb72c2e9a8ac Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Thu, 31 Dec 2020 23:20:24 +0100 Subject: fix(CLI): properly get zsh command in `omz update` (#9558) Zsh versions older than 5.3 don't have ZSH_ARGZERO, so use an alternative method to get the zsh command. Fixes #9558 --- lib/cli.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/cli.zsh') diff --git a/lib/cli.zsh b/lib/cli.zsh index 92d447a8e..6fcffdf87 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -391,7 +391,9 @@ function _omz::update { # Restart the zsh session if [[ $ret -eq 0 && "$1" != --unattended ]]; then + # Old zsh versions don't have ZSH_ARGZERO + local zsh="${ZSH_ARGZERO:-${functrace[-1]%:*}}" # Check whether to run a login shell - [[ "$ZSH_ARGZERO" = -* ]] && exec -l "${ZSH_ARGZERO#-}" || exec "$ZSH_ARGZERO" + [[ "$zsh" = -* || -o login ]] && exec -l "${zsh#-}" || exec "$zsh" fi } -- cgit v1.2.3-70-g09d2