From 572a07c72d95324d5f230269138ac273a9c0cfd9 Mon Sep 17 00:00:00 2001 From: Kevin Song Date: Sun, 18 Aug 2019 04:07:38 -0700 Subject: [PATCH] fix: Correct broken zsh init in absence of precmd_functions (#180) --- src/init.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/init.rs b/src/init.rs index d4afefe0..5d2ad65f 100644 --- a/src/init.rs +++ b/src/init.rs @@ -152,6 +152,12 @@ starship_precmd() { starship_preexec(){ STARSHIP_START_TIME="$(date +%s)" }; +if [[ -z "${precmd_functions+1}" ]]; then + precmd_functions=() +fi; +if [[ -z "${preexec_functions+1}" ]]; then + preexec_functions=() +fi; if [[ ${precmd_functions[(ie)starship_precmd]} -gt ${#precmd_functions} ]]; then precmd_functions+=(starship_precmd); fi;