Browse Source

[history-substring-search] Verify terminfo before bindkey

Closes #341
Grant Guthrie 4 years ago
parent
commit
d19c8dde68
1 changed files with 4 additions and 2 deletions
  1. 4 2
      modules/history-substring-search/init.zsh

+ 4 - 2
modules/history-substring-search/init.zsh

@@ -11,5 +11,7 @@ bindkey '^[[B' history-substring-search-down
 
 # Bind up and down keys
 zmodload -F zsh/terminfo +p:terminfo
-bindkey "${terminfo[kcuu1]}" history-substring-search-up
-bindkey "${terminfo[kcud1]}" history-substring-search-down
+if [[ -n ${terminfo[kcuu1]} && -n ${terminfo[kcud1]} ]]; then
+  bindkey ${terminfo[kcuu1]} history-substring-search-up
+  bindkey ${terminfo[kcud1]} history-substring-search-down
+fi