From 6186e296ac328d04b0427b2256eb37223daf5fdc Mon Sep 17 00:00:00 2001 From: David Knaack Date: Mon, 14 Sep 2020 08:30:57 +0200 Subject: [PATCH] fix(zsh): work when `setopt ksh_arrays` is set (#1612) --- src/init/starship.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/init/starship.zsh b/src/init/starship.zsh index 5c521b94c..ed8452de9 100644 --- a/src/init/starship.zsh +++ b/src/init/starship.zsh @@ -46,10 +46,10 @@ starship_preexec() { # If starship precmd/preexec functions are already hooked, don't double-hook them # to avoid unnecessary performance degradation in nested shells -if [[ ${precmd_functions[(ie)starship_precmd]} -gt ${#precmd_functions} ]]; then +if [[ -z ${precmd_functions[(re)starship_precmd]} ]]; then precmd_functions+=(starship_precmd) fi -if [[ ${preexec_functions[(ie)starship_preexec]} -gt ${#preexec_functions} ]]; then +if [[ -z ${preexec_function[(re)starship_preexec]} ]]; then preexec_functions+=(starship_preexec) fi