diff --git a/src/init/starship.zsh b/src/init/starship.zsh index 5c521b94..ed8452de 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