From ea5ec6b865d6215a34c787b7a237de970ef120e3 Mon Sep 17 00:00:00 2001 From: druckdev <63563978+druckdev@users.noreply.github.com> Date: Sat, 22 Aug 2020 16:24:49 +0200 Subject: [PATCH] Check termcap before putting in application mode --- .config/zsh/plugins/keys.zsh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.config/zsh/plugins/keys.zsh b/.config/zsh/plugins/keys.zsh index ae7acf0..286cf58 100644 --- a/.config/zsh/plugins/keys.zsh +++ b/.config/zsh/plugins/keys.zsh @@ -13,15 +13,17 @@ function zle-line-init zle-keymap-select { 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 + # Make sure that the terminal is in application mode when zle is active, + # since only then values from $terminfo are valid + ! (( $+terminfo[smkx] )) || echoti smkx } zle -N zle-line-init zle -N zle-keymap-select -# See above (echoti smkx) -function zle-line-finish { echoti rmkx; } +function zle-line-finish { + # See above (echoti smkx) + ! (( $+terminfo[rmkx] )) || echoti rmkx +} zle -N zle-line-finish bindkey '^[h' run-help