diff options
author | romkatv <roman.perepelitsa@gmail.com> | 2020-02-03 13:47:39 +0300 |
---|---|---|
committer | romkatv <roman.perepelitsa@gmail.com> | 2020-02-03 13:47:39 +0300 |
commit | 4b62cd7380b55115f5f7e184484c9b8081f2f1a7 (patch) | |
tree | dfe3c76969102bd96eb80d7dd934a6cd9115226a /internal/worker.zsh | |
parent | a0535ffcd6c352007868ffb6a57c0187997f64bc (diff) |
bug fix: make reset=2 sticky
Diffstat (limited to 'internal/worker.zsh')
-rw-r--r-- | internal/worker.zsh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/worker.zsh b/internal/worker.zsh index 6b369740..a7db4596 100644 --- a/internal/worker.zsh +++ b/internal/worker.zsh @@ -121,7 +121,7 @@ function _p9k_worker_receive() { sysread -i $_p9k__worker_resp_fd 'buf[$#buf+1]' || return done - local -i reset + local -i reset max_reset for resp in ${(ps:\x1e:)${buf//$'\x05'}}; do local arg=$resp[2,-1] case $resp[1] in @@ -142,6 +142,7 @@ function _p9k_worker_receive() { start_time=0 fi () { eval $arg } + (( reset > max_reset )) && max_reset=reset ;; s) [[ -z $_p9k__worker_pid ]] || return @@ -160,12 +161,12 @@ function _p9k_worker_receive() { esac done - if (( reset == 2 )); then + if (( max_reset == 2 )); then _p9k_refresh_reason=worker _p9k_set_prompt _p9k_refresh_reason='' fi - (( reset )) && _p9k_reset_prompt + (( max_reset )) && _p9k_reset_prompt return 0 } always { (( $? )) && _p9k_worker_stop |