From a79b604321d84b8b9e2d4ae4a7839cf68a70f02c Mon Sep 17 00:00:00 2001 From: Grant Guthrie Date: Wed, 25 Sep 2019 14:42:51 -0400 Subject: [PATCH] Verify terminfo before bindkey --- modules/history-substring-search/init.zsh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/history-substring-search/init.zsh b/modules/history-substring-search/init.zsh index 2d8ea43..97a519a 100644 --- a/modules/history-substring-search/init.zsh +++ b/modules/history-substring-search/init.zsh @@ -11,5 +11,9 @@ 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 [[ "${terminfo[kcuu1]}" != "" ]]; then + bindkey "${terminfo[kcuu1]}" history-substring-search-up +fi +if [[ "${terminfo[kcud1]}" != "" ]]; then + bindkey "${terminfo[kcud1]}" history-substring-search-down +fi