From d19c8dde68b338fcc096bbce683c47ad068b46d3 Mon Sep 17 00:00:00 2001 From: Grant Guthrie Date: Wed, 25 Sep 2019 14:42:51 -0400 Subject: [PATCH] [history-substring-search] Verify terminfo before bindkey Closes #341 --- modules/history-substring-search/init.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/history-substring-search/init.zsh b/modules/history-substring-search/init.zsh index 2d8ea43..2fe8fc0 100644 --- a/modules/history-substring-search/init.zsh +++ b/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