From 6e120b9eecaf995c9d7d69e13c3389be549240a7 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 9 Jun 2020 12:58:48 +0200 Subject: [PATCH] don't initialize vcs if there is no git command --- internal/p10k.zsh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index fc4a3dae..f191bb64 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7717,7 +7717,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v93\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v94\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$GITSTATUS_CACHE_DIR\1$GITSTATUS_AUTO_INSTALL\1${ZLE_RPROMPT_INDENT:-1}\1' @@ -7726,6 +7726,7 @@ _p9k_must_init() { _p9k__param_pat+=$'$VTE_VERSION\1$TERM_PROGRAM\1$DEFAULT_USER\1$P9K_SSH\1$commands[uname]\1' _p9k__param_pat+=$'$__p9k_root_dir\1$functions[p10k-on-init]$functions[p10k-on-pre-prompt]\1' _p9k__param_pat+=$'$functions[p10k-on-post-widget]$functions[p10k-on-post-prompt]\1' + _p9k__param_pat+=$'$+commands[git]' local MATCH IFS=$'\1' _p9k__param_pat+="${(@)${(@o)parameters[(I)POWERLEVEL9K_*]}:/(#m)*/\${${(q)MATCH}-$IFS\}}" IFS=$'\2' _p9k__param_sig="${(e)_p9k__param_pat}" @@ -7969,6 +7970,13 @@ function _p9k_init_cacheable() { _p9k_init_vcs() { _p9k_segment_in_use vcs || return + if [[ $#_POWERLEVEL9K_VCS_BACKENDS -le 1 && $_POWERLEVEL9K_VCS_BACKENDS == git && + $+commands[git] == 0 ]]; then + (( $+functions[gitstatus_stop_p9k_] )) && gitstatus_stop_p9k_ POWERLEVEL9K + unset _p9k_preinit + return + fi + _p9k_vcs_info_init if (( $+functions[_p9k_preinit] )); then if (( $+GITSTATUS_DAEMON_PID_POWERLEVEL9K )); then