5eb5f7138a0a70cf34285b25d1cc205c93f2c56d
- Author
- Robby Russell <robby@planetargon.com>
- Committer
- Robby Russell <robby@planetargon.com>
- Date
Message
Merge pull request #2511 from FloFra/master
Makes history-substring-search use term specific up and down buttons.
Diff
1diff --git a/plugins/history-substring-search/history-substring-search.zsh b/plugins/history-substring-search/history-substring-search.zsh
2index 53f707c79c11c72931fcae67eeb6931b29cbade0..22f03dd6d8bffecdc947ddb1262a55497d557171 100644
3--- a/plugins/history-substring-search/history-substring-search.zsh
4+++ b/plugins/history-substring-search/history-substring-search.zsh
5@@ -163,8 +163,13 @@ function history-substring-search-down() {
6 zle -N history-substring-search-up
7 zle -N history-substring-search-down
8
9-bindkey '\e[A' history-substring-search-up
10-bindkey '\e[B' history-substring-search-down
11+zmodload zsh/terminfo
12+if [[ -n "$terminfo[kcuu1]" ]]; then
13+ bindkey "$terminfo[kcuu1]" history-substring-search-up
14+fi
15+if [[ -n "$terminfo[kcud1]" ]]; then
16+ bindkey "$terminfo[kcud1]" history-substring-search-down
17+fi
18
19 #-----------------------------------------------------------------------------
20 # implementation details