From 58a0139e665597a9fdb158a360144520fcaf5efe Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Sat, 4 Aug 2012 15:15:28 -0400 Subject: [PATCH] Ensure that $terminfo values are valid --- 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 04a4e61967..5e6295c1f7 100644 --- a/modules/editor/init.zsh +++ b/modules/editor/init.zsh @@ -134,8 +134,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