Skip to content

Commit

Permalink
Revert "Make sure psvar[11] gets updated"
Browse files Browse the repository at this point in the history
This reverts commit b60acf5.
  • Loading branch information
agkozak committed Oct 17, 2021
1 parent b60acf5 commit 267822d
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions agkozak-zsh-prompt.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ AGKOZAK[FUNCTIONS]='_agkozak_debug_print
_agkozak_set_git_psvars
_agkozak_zle-keymap-select
TRAPWINCH
_agkozak_update_psvar11
TRAPCHLD
_agkozak_vi_mode_indicator
_agkozak_load_async_lib
Expand Down Expand Up @@ -518,24 +517,12 @@ TRAPWINCH() {
zle && zle -R
}

############################################################
# Help TRAPCHLD update psvar[11]
#
# See https://zsh.org/mla/workers/2016/msg00257.html
############################################################
_agkozak_update_psvar11() {
unset "AGKOZAK[TRAPCHLD_CALLED]"
psvar[11]=${${(%):-%j}#0}
zle && zle reset-prompt
(( AGKOZAK[TRAPCHLD_CALLED] )) && _agkozak_update_psvar11
}

############################################################
# Redraw the prompt when the background jobs count changes
############################################################
TRAPCHLD() {
_agkozak_update_psvar11
AGKOZAK[TRAPCHD_CALLED]=1
psvar[11]=${${(%):-%j}#0}
zle && zle reset-prompt
}

############################################################
Expand Down

0 comments on commit 267822d

Please sign in to comment.