diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh index 27fb47c97..a06100472 100644 --- a/plugins/vi-mode/vi-mode.plugin.zsh +++ b/plugins/vi-mode/vi-mode.plugin.zsh @@ -3,18 +3,13 @@ function zle-keymap-select zle-line-init zle-line-finish { # The terminal must be in application mode when ZLE is active for $terminfo # values to be valid. - if (( $+terminfo[smkx] && $+terminfo[rmkx] )); then - case "$0" in - (zle-line-init) - # Enable terminal application mode. - printf '%s' ${terminfo[smkx]} - ;; - (zle-line-finish) - # Disable terminal application mode. - printf '%s' ${terminfo[rmkx]} - ;; - esac + if (( ${+terminfo[smkx]} )); then + printf '%s' ${terminfo[smkx]} fi + if (( ${+terminfo[rmkx]} )); then + printf '%s' ${terminfo[rmkx]} + fi + zle reset-prompt zle -R }