Skip to content

Commit

Permalink
Ensure that $terminfo values are valid
Browse files Browse the repository at this point in the history
  • Loading branch information
sorin-ionescu committed Aug 4, 2012
1 parent 6006547 commit 58a0139
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion modules/editor/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 58a0139

Please sign in to comment.