浏览代码

history-substring-search: bindkey now checks if terminfo is available first.

Florian Franzen 11 年之前
父节点
当前提交
5303793ef1
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      plugins/history-substring-search/history-substring-search.zsh

+ 6 - 2
plugins/history-substring-search/history-substring-search.zsh

@@ -164,8 +164,12 @@ zle -N history-substring-search-up
 zle -N history-substring-search-down
 
 zmodload zsh/terminfo
-bindkey "$terminfo[kcuu1]" history-substring-search-up
-bindkey "$terminfo[kcud1]" history-substring-search-down
+if [[ -n "$terminfo[kcuu1]" ]]; then
+  bindkey "$terminfo[kcuu1]" history-substring-search-up
+fi
+if [[ -n "$terminfo[kcud1]" ]]; then
+  bindkey "$terminfo[kcud1]" history-substring-search-down
+fi
 
 #-----------------------------------------------------------------------------
 # implementation details