diff --git a/async.zsh b/async.zsh index 0a0f1b9..e24e9c4 100644 --- a/async.zsh +++ b/async.zsh @@ -81,7 +81,12 @@ _async_worker() { # Check for non-job commands sent to worker case "$job" in _killjobs) - kill -KILL ${${(v)jobstates##*:*:}%\=*} &>/dev/null + # Do nothing in the worker when receiving the TERM signal + trap '' TERM + # Send TERM to the entire process group (PID and all children) + kill -TERM -$$ &>/dev/null + # Reset trap + trap - TERM continue ;; esac diff --git a/pure.zsh b/pure.zsh index b7acaee..ba9b312 100644 --- a/pure.zsh +++ b/pure.zsh @@ -100,6 +100,9 @@ prompt_pure_set_title() { } prompt_pure_preexec() { + # attempt to detect and prevent prompt_pure_async_git_fetch from interfering with user initiated git or hub fetch + [[ $2 =~ (git|hub)\ .*(pull|fetch) ]] && async_flush_jobs 'prompt_pure' + prompt_pure_cmd_timestamp=$EPOCHSECONDS # shows the current dir and executed command in the title while a process is active