From a180a09f6fe957e34fbc305fbeaef2f3a6690ed1 Mon Sep 17 00:00:00 2001 From: druckdev <63563978+druckdev@users.noreply.github.com> Date: Tue, 30 Jun 2020 03:54:42 +0200 Subject: [PATCH] Make sure that the terminfo values are valid --- .config/zsh/plugins/keys.zsh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.config/zsh/plugins/keys.zsh b/.config/zsh/plugins/keys.zsh index 6b2155d..579403e 100644 --- a/.config/zsh/plugins/keys.zsh +++ b/.config/zsh/plugins/keys.zsh @@ -6,16 +6,24 @@ # no delay when switching into NORMAL export KEYTIMEOUT=1 - # Switch cursor style depending on mode function zle-line-init zle-keymap-select { + # Switch cursor style depending on mode case $KEYMAP in vicmd) echo -ne "\e[1 q";; # block viins|main) echo -ne "\e[5 q";; # beam esac + + # Make sure that the terminal is in application mode when zle is active, since + # only then values from $terminfo are valid + echoti smkx } zle -N zle-line-init zle -N zle-keymap-select + # See above (echoti smkx) + function zle-line-finish { echoti rmkx; } + zle -N zle-line-finish + bindkey '^[h' run-help ## History ## Alternatives to check out: {up,down}-line-or-search