1
0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-12-12 19:18:28 +02:00

ignore zshexit hook calls done from forks

This commit is contained in:
romkatv 2019-08-06 09:57:04 +02:00
parent 9d6dfeae73
commit 36d2c588f1

View File

@ -3246,6 +3246,8 @@ _p9k_deinit_async_pump() {
rm -f $_p9k_async_pump_lock rm -f $_p9k_async_pump_lock
_p9k_async_pump_lock='' _p9k_async_pump_lock=''
fi fi
_p9k_async_pump_subshell=-1
_p9k_async_pump_shell_pid=-1
add-zsh-hook -D zshexit _p9k_kill_async_pump add-zsh-hook -D zshexit _p9k_kill_async_pump
} }
@ -3327,7 +3329,7 @@ function _p9k_async_pump() {
function _p9k_kill_async_pump() { function _p9k_kill_async_pump() {
emulate -L zsh && setopt no_hist_expand extended_glob no_prompt_bang prompt_{cr,percent,subst,sp} emulate -L zsh && setopt no_hist_expand extended_glob no_prompt_bang prompt_{cr,percent,subst,sp}
if (( ZSH_SUBSHELL == _p9k_async_pump_subshell )); then if [[ $ZSH_SUBSHELL == $_p9k_async_pump_subshell && $$ == $_p9k_async_pump_shell_pid ]]; then
_p9k_deinit_async_pump _p9k_deinit_async_pump
fi fi
} }
@ -3365,6 +3367,7 @@ _p9k_init_async_pump() {
IFS='' read -t 5 -r -u $_p9k_async_pump_fd _p9k_async_pump_pid && (( _p9k_async_pump_pid )) IFS='' read -t 5 -r -u $_p9k_async_pump_fd _p9k_async_pump_pid && (( _p9k_async_pump_pid ))
_p9k_async_pump_subshell=$ZSH_SUBSHELL _p9k_async_pump_subshell=$ZSH_SUBSHELL
_p9k_async_pump_shell_pid=$$
add-zsh-hook zshexit _p9k_kill_async_pump add-zsh-hook zshexit _p9k_kill_async_pump
} }
@ -3431,6 +3434,7 @@ _p9k_init_vars() {
typeset -gi _p9k_async_pump_fd typeset -gi _p9k_async_pump_fd
typeset -gi _p9k_async_pump_pid typeset -gi _p9k_async_pump_pid
typeset -gi _p9k_async_pump_subshell typeset -gi _p9k_async_pump_subshell
typeset -gi _p9k_async_pump_shell_pid
typeset -ga _p9k_line_segments_left typeset -ga _p9k_line_segments_left
typeset -ga _p9k_line_segments_right typeset -ga _p9k_line_segments_right
typeset -ga _p9k_line_prefix_left typeset -ga _p9k_line_prefix_left