block SIGINT in nested p10k calls; allow SIGINT in gitstatus_start

pull/778/head
romkatv 5 years ago
parent c0ff47bea5
commit e3beeea0ae

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

@ -23,8 +23,7 @@
# __p9k_trapint is to work around bugs in zsh: https://www.zsh.org/mla/workers/2020/msg00612.html. # __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 ""`. # 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 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 (( $+__p9k_trapped )) || { local -i __p9k_trapped; trap : INT; trap "trap ${(q)__p9k_trapint:--} INT" EXIT }
trap "trap ${(q)__p9k_trapint:--} INT" EXIT
local -a match mbegin mend local -a match mbegin mend
local -i MBEGIN MEND OPTIND local -i MBEGIN MEND OPTIND
local MATCH OPTARG IFS=$'\'' \t\n\0'\' 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 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 _p9k_preinit
fi fi
typeset -gr __p9k_sourced=11 typeset -gr __p9k_sourced=12
if [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]]; then if [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]]; then
if [[ -w $__p9k_root_dir && -w $__p9k_root_dir/internal && -w $__p9k_root_dir/gitstatus ]]; then if [[ -w $__p9k_root_dir && -w $__p9k_root_dir/internal && -w $__p9k_root_dir/gitstatus ]]; then
local f local f

Loading…
Cancel
Save