fix(zsh): work when setopt ksh_arrays is set (#1612)

This commit is contained in:
David Knaack 2020-09-14 08:30:57 +02:00 committed by GitHub
parent 2996220568
commit 6186e296ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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