1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-24 13:10:07 +00:00

block SIGINT in nested p10k calls; allow SIGINT in gitstatus_start

This commit is contained in:
romkatv 2020-05-19 10:10:43 +02:00
parent c0ff47bea5
commit e3beeea0ae
2 changed files with 28 additions and 13 deletions

View file

@ -1,4 +1,4 @@
if [[ $__p9k_sourced != 11 ]]; then
if [[ $__p9k_sourced != 12 ]]; then
>&2 print -P ""
>&2 print -P "[%F{1}ERROR%f]: Corrupted powerlevel10k installation."
>&2 print -P ""
@ -7882,7 +7882,16 @@ _p9k_init_vcs() {
_p9k_segment_in_use vcs || return
_p9k_vcs_info_init
if (( $+functions[_p9k_preinit] )); then
(( $+GITSTATUS_DAEMON_PID_POWERLEVEL9K )) && gitstatus_start_p9k_ POWERLEVEL9K
if (( $+GITSTATUS_DAEMON_PID_POWERLEVEL9K )); then
() {
trap 'return 130' INT
{
gitstatus_start_p9k_ POWERLEVEL9K
} always {
trap ':' INT
}
}
fi
return 0
fi
(( _POWERLEVEL9K_DISABLE_GITSTATUS )) && return
@ -7910,14 +7919,21 @@ _p9k_init_vcs() {
-a POWERLEVEL9K
}"
source $gitstatus_dir/gitstatus.plugin.zsh _p9k_ || return
gitstatus_start_p9k_ \
-s $_POWERLEVEL9K_VCS_STAGED_MAX_NUM \
-u $_POWERLEVEL9K_VCS_UNSTAGED_MAX_NUM \
-d $_POWERLEVEL9K_VCS_UNTRACKED_MAX_NUM \
-c $_POWERLEVEL9K_VCS_CONFLICTED_MAX_NUM \
-m $_POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY \
${${_POWERLEVEL9K_VCS_RECURSE_UNTRACKED_DIRS:#0}:+-e} \
POWERLEVEL9K
() {
trap 'return 130' INT
{
gitstatus_start_p9k_ \
-s $_POWERLEVEL9K_VCS_STAGED_MAX_NUM \
-u $_POWERLEVEL9K_VCS_UNSTAGED_MAX_NUM \
-d $_POWERLEVEL9K_VCS_UNTRACKED_MAX_NUM \
-c $_POWERLEVEL9K_VCS_CONFLICTED_MAX_NUM \
-m $_POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY \
${${_POWERLEVEL9K_VCS_RECURSE_UNTRACKED_DIRS:#0}:+-e} \
POWERLEVEL9K
} always {
trap ':' INT
}
}
}
_p9k_init() {

View file

@ -23,8 +23,7 @@
# __p9k_trapint is to work around bugs in zsh: https://www.zsh.org/mla/workers/2020/msg00612.html.
# Likewise for `trap ":"` instead of the plain `trap ""`.
typeset -gr __p9k_intro_base='emulate -L zsh -o no_hist_expand -o extended_glob -o no_prompt_bang -o prompt_percent -o no_prompt_subst -o no_aliases -o no_bg_nice -o typeset_silent
trap ":" INT
trap "trap ${(q)__p9k_trapint:--} INT" EXIT
(( $+__p9k_trapped )) || { local -i __p9k_trapped; trap : INT; trap "trap ${(q)__p9k_trapint:--} INT" EXIT }
local -a match mbegin mend
local -i MBEGIN MEND OPTIND
local MATCH OPTARG IFS=$'\'' \t\n\0'\'
@ -58,7 +57,7 @@ function _p9k_init_locale() {
if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file ]] && (( ! $+functions[_p9k_preinit] )) && source $__p9k_dump_file 2>/dev/null && (( $+functions[_p9k_preinit] )); then
_p9k_preinit
fi
typeset -gr __p9k_sourced=11
typeset -gr __p9k_sourced=12
if [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]]; then
if [[ -w $__p9k_root_dir && -w $__p9k_root_dir/internal && -w $__p9k_root_dir/gitstatus ]]; then
local f