From 003dd8f4b68062b7fd5e4e1725264189ee56e28a Mon Sep 17 00:00:00 2001 From: Greg Berenfield Date: Wed, 2 Jan 2013 16:20:22 -0500 Subject: [PATCH 1/2] fix for Issue 1479 --- plugins/vi-mode/vi-mode.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh index f91be70e..27fb47c9 100644 --- a/plugins/vi-mode/vi-mode.plugin.zsh +++ b/plugins/vi-mode/vi-mode.plugin.zsh @@ -7,11 +7,11 @@ function zle-keymap-select zle-line-init zle-line-finish { case "$0" in (zle-line-init) # Enable terminal application mode. - echoti smkx + printf '%s' ${terminfo[smkx]} ;; (zle-line-finish) # Disable terminal application mode. - echoti rmkx + printf '%s' ${terminfo[rmkx]} ;; esac fi From 93c90a6bf5817d09e978bd720eaa7f9be971a1c6 Mon Sep 17 00:00:00 2001 From: Greg Berenfield Date: Wed, 2 Jan 2013 19:14:57 -0500 Subject: [PATCH 2/2] Fix the fix for Issue #1479 --- plugins/vi-mode/vi-mode.plugin.zsh | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh index 27fb47c9..a0610047 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 }