diff options
author | Kevin Song <chipbuster@users.noreply.github.com> | 2019-08-18 04:07:38 -0700 |
---|---|---|
committer | Matan Kushner <hello@matchai.me> | 2019-08-18 07:07:38 -0400 |
commit | 572a07c72d95324d5f230269138ac273a9c0cfd9 (patch) | |
tree | f1ac714a1a8b5b7c57b3f248f26973bfc6584950 /src | |
parent | dfe2ae643af77b882ae1cfbe81fa74d62250eb93 (diff) |
fix: Correct broken zsh init in absence of precmd_functions (#180)
Diffstat (limited to 'src')
-rw-r--r-- | src/init.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/init.rs b/src/init.rs index d4afefe00..5d2ad65f8 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; |