diff options
-rw-r--r-- | debian/zshrc | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/debian/zshrc b/debian/zshrc index 4a0bfb44f..716bce629 100644 --- a/debian/zshrc +++ b/debian/zshrc @@ -8,6 +8,9 @@ READNULLCMD=${PAGER:-/usr/bin/pager} +# An array to note missing features to ease diagnosis in case of problems. +typeset -ga debian_missing_features + if [[ -z "$DEBIAN_PREVENT_KEYBOARD_CHANGES" ]] && [[ "$TERM" != 'emacs' ]] then @@ -63,14 +66,21 @@ then # Make sure the terminal is in application mode, when zle is # active. Only then are the values from $terminfo valid. - function zle-line-init () { - echoti smkx - } - function zle-line-finish () { - echoti rmkx - } - zle -N zle-line-init - zle -N zle-line-finish + if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then + function zle-line-init () { + echoti smkx + } + function zle-line-finish () { + echoti rmkx + } + zle -N zle-line-init + zle -N zle-line-finish + else + for i in {s,r}mkx; do + (( ${+terminfo[$i]} )) || debian_missing_features+=($i) + done + unset i + fi unfunction bind2maps |