diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh index 3ed32b3fb..f2745b409 100644 --- a/plugins/vi-mode/vi-mode.plugin.zsh +++ b/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