浏览代码

Verify zle is active before trying to reset-prompt.

Brian Derr 10 年之前
父节点
当前提交
bc8abe5ea2
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      plugins/vi-mode/vi-mode.plugin.zsh

+ 6 - 2
plugins/vi-mode/vi-mode.plugin.zsh

@@ -17,8 +17,12 @@ function zle-keymap-select zle-line-init zle-line-finish {
 # Ensure that the prompt is redrawn when the terminal size changes.
 # Ensure that the prompt is redrawn when the terminal size changes.
 TRAPWINCH() {
 TRAPWINCH() {
   if [[ -o zle ]]; then
   if [[ -o zle ]]; then
-    zle reset-prompt
-    zle -R
+    # Verify that zle is active before trying to reset-prompt.
+    zle
+    if [[ $? -eq 0 ]]; then
+      zle reset-prompt
+      zle -R
+    fi
   fi
   fi
 }
 }