Skip to content

Commit 9a8f9b6

Browse files
committed
Use TRAPCHLD function to refresh prompt
1 parent 6b76bf3 commit 9a8f9b6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

agkozak-zsh-prompt.plugin.zsh

+9
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ AGKOZAK[FUNCTIONS]='_agkozak_debug_print
124124
_agkozak_set_git_psvars
125125
_agkozak_zle-keymap-select
126126
TRAPWINCH
127+
TRAPCHLD
127128
_agkozak_vi_mode_indicator
128129
_agkozak_load_async_lib
129130
_agkozak_has_usr1
@@ -516,6 +517,14 @@ TRAPWINCH() {
516517
zle && zle -R
517518
}
518519

520+
############################################################
521+
# Redraw the prompt when the background jobs count changes
522+
############################################################
523+
TRAPCHLD() {
524+
psvar[11]=${${(%):-%j}#0}
525+
zle && zle reset-prompt
526+
}
527+
519528
############################################################
520529
# For legacy custom prompts: print a vi mode indicator
521530
############################################################

0 commit comments

Comments
 (0)