8ebf2a678507b28cf107858b316f5e874ef73d0f

Author
Giuseppe Landolfi <giuseppe.landolfi@gmail.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

Fine-tune dirhistory plugin mappings for Mac (#6580)

See https://github.com/robbyrussell/oh-my-zsh/pull/6533#issuecomment-360878060

Diff

 1diff --git a/plugins/dirhistory/dirhistory.plugin.zsh b/plugins/dirhistory/dirhistory.plugin.zsh
 2index 8138872bc4d2f168e115e2808ab96e5aac2d2db0..283dace2923094c6b05446c053abf378adb1327e 100644
 3--- a/plugins/dirhistory/dirhistory.plugin.zsh
 4+++ b/plugins/dirhistory/dirhistory.plugin.zsh
 5@@ -120,7 +120,9 @@ zle -N dirhistory_zle_dirhistory_back
 6 bindkey "\e[3D" dirhistory_zle_dirhistory_back
 7 bindkey "\e[1;3D" dirhistory_zle_dirhistory_back
 8 # Mac teminal (alt+left/right)
 9-bindkey "^[b" dirhistory_zle_dirhistory_back
10+if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]]; then
11+  bindkey "^[b" dirhistory_zle_dirhistory_back
12+fi
13 # Putty:
14 bindkey "\e\e[D" dirhistory_zle_dirhistory_back
15 # GNU screen:
16@@ -129,7 +131,9 @@ bindkey "\eO3D" dirhistory_zle_dirhistory_back
17 zle -N dirhistory_zle_dirhistory_future
18 bindkey "\e[3C" dirhistory_zle_dirhistory_future
19 bindkey "\e[1;3C" dirhistory_zle_dirhistory_future
20-bindkey "^[f" dirhistory_zle_dirhistory_future
21+if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]]; then
22+  bindkey "^[f" dirhistory_zle_dirhistory_future
23+fi
24 bindkey "\e\e[C" dirhistory_zle_dirhistory_future
25 bindkey "\eO3C" dirhistory_zle_dirhistory_future
26