From 52db7bb0f655268da24bc0da42606ca2fc5626f7 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Wed, 17 Oct 2012 12:39:10 -0400 Subject: [PATCH] [#263, #314] Undo revert of "Ensure that $terminfo values are valid" This reverts commit ed4e9af9c41d08876a76a54a3dece174b92c066d. --- modules/editor/init.zsh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/modules/editor/init.zsh b/modules/editor/init.zsh index dc2cfa5..f996851 100644 --- a/modules/editor/init.zsh +++ b/modules/editor/init.zsh @@ -141,8 +141,23 @@ function editor-info { } zle -N editor-info -# Updates editor information when the keymap changes. +# Ensures that $terminfo values are valid and updates editor information when +# the keymap changes. 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. + case "$0" in + (zle-line-init) + # Enable terminal application mode. + echoti smkx + ;; + (zle-line-finish) + # Disable terminal application mode. + echoti rmkx + ;; + esac + + # Update editor information. zle editor-info } zle -N zle-keymap-select