bc8abe5ea26aa031395c754e3e9710dcc62dd0f0

Author
Brian Derr <brian@derrclan.com>
Committer
Brian Derr <brian@derrclan.com>
Date

Message

Verify zle is active before trying to reset-prompt.

Diff

 1diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh
 2index f2745b409097c6cdf6c5a02069728e8b18f2f632..ac9233290607f0010570385c5791fa6eef738654 100644
 3--- a/plugins/vi-mode/vi-mode.plugin.zsh
 4+++ b/plugins/vi-mode/vi-mode.plugin.zsh
 5@@ -17,8 +17,12 @@ function zle-keymap-select zle-line-init zle-line-finish {
 6 # Ensure that the prompt is redrawn when the terminal size changes.
 7 TRAPWINCH() {
 8   if [[ -o zle ]]; then
 9-    zle reset-prompt
10-    zle -R
11+    # Verify that zle is active before trying to reset-prompt.
12+    zle
13+    if [[ $? -eq 0 ]]; then
14+      zle reset-prompt
15+      zle -R
16+    fi
17   fi
18 }
19