浏览代码

Merge pull request #3547 from martong/vi_mode_trapwinch

Added trapwinch to vi-mode plugin.
Robby Russell 9 年之前
父节点
当前提交
49b4e675e0
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      plugins/vi-mode/vi-mode.plugin.zsh

+ 8 - 0
plugins/vi-mode/vi-mode.plugin.zsh

@@ -14,6 +14,14 @@ function zle-keymap-select zle-line-init zle-line-finish {
   zle -R
 }
 
+# Ensure that the prompt is redrawn when the terminal size changes.
+TRAPWINCH() {
+  if [[ -o zle ]]; then
+    zle reset-prompt
+    zle -R
+  fi
+}
+
 zle -N zle-line-init
 zle -N zle-line-finish
 zle -N zle-keymap-select