summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobby Russell <robby@planetargon.com>2014-04-19 12:54:10 -0700
committerRobby Russell <robby@planetargon.com>2014-04-19 12:54:10 -0700
commit5eb5f7138a0a70cf34285b25d1cc205c93f2c56d (patch)
tree5e9a4d6c462b4171e1824fbf39872b6eb56383f6
parent8aa6e6a412258c6a8210a9a18c407377ac187c9d (diff)
parent5303793ef13b5dd3e7f52ac40f17fd37f015af44 (diff)
downloadzsh-5eb5f7138a0a70cf34285b25d1cc205c93f2c56d.tar.gz
zsh-5eb5f7138a0a70cf34285b25d1cc205c93f2c56d.tar.bz2
zsh-5eb5f7138a0a70cf34285b25d1cc205c93f2c56d.zip
Merge pull request #2511 from FloFra/master
Makes history-substring-search use term specific up and down buttons.
-rw-r--r--plugins/history-substring-search/history-substring-search.zsh9
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/history-substring-search/history-substring-search.zsh b/plugins/history-substring-search/history-substring-search.zsh
index 53f707c79..22f03dd6d 100644
--- a/plugins/history-substring-search/history-substring-search.zsh
+++ b/plugins/history-substring-search/history-substring-search.zsh
@@ -163,8 +163,13 @@ function history-substring-search-down() {
zle -N history-substring-search-up
zle -N history-substring-search-down
-bindkey '\e[A' history-substring-search-up
-bindkey '\e[B' history-substring-search-down
+zmodload zsh/terminfo
+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