85d60d489c54150cc9df5cef0504f6af90638fbd

Author
Kristijan <kris@kristijan.org>
Committer
GitHub <noreply@github.com>
Date

Message

feat(dirhistory): add support for ghostty (#12868)

Diff

 1diff --git a/plugins/dirhistory/dirhistory.plugin.zsh b/plugins/dirhistory/dirhistory.plugin.zsh
 2index 8d67c61886430f7b613b978de5ebd24351883f4d..8d66de7f54c5238ab1e7d021aa53bde9d16785f2 100644
 3--- a/plugins/dirhistory/dirhistory.plugin.zsh
 4+++ b/plugins/dirhistory/dirhistory.plugin.zsh
 5@@ -137,6 +137,7 @@ for keymap in emacs vicmd viins; do
 6   case "$TERM_PROGRAM" in
 7   Apple_Terminal) bindkey -M $keymap "^[b" dirhistory_zle_dirhistory_back ;; # Terminal.app
 8   iTerm.app) bindkey -M $keymap "^[^[[D" dirhistory_zle_dirhistory_back ;;   # iTerm2
 9+  ghostty) bindkey -M $keymap "^[b" dirhistory_zle_dirhistory_back ;;        # ghostty
10   esac
11 
12   if (( ${+terminfo[kcub1]} )); then
13@@ -152,6 +153,7 @@ for keymap in emacs vicmd viins; do
14   case "$TERM_PROGRAM" in
15   Apple_Terminal) bindkey -M $keymap "^[f" dirhistory_zle_dirhistory_future ;; # Terminal.app
16   iTerm.app) bindkey -M $keymap "^[^[[C" dirhistory_zle_dirhistory_future ;;   # iTerm2
17+  ghostty) bindkey -M $keymap "^[f" dirhistory_zle_dirhistory_future ;;        # ghostty
18   esac
19 
20   if (( ${+terminfo[kcuf1]} )); then
21@@ -200,6 +202,7 @@ for keymap in emacs vicmd viins; do
22   case "$TERM_PROGRAM" in
23   Apple_Terminal) bindkey -M $keymap "^[[A" dirhistory_zle_dirhistory_up ;;  # Terminal.app
24   iTerm.app) bindkey -M $keymap "^[^[[A" dirhistory_zle_dirhistory_up ;;     # iTerm2
25+  ghostty) bindkey -M $keymap "^[[1;3A" dirhistory_zle_dirhistory_up ;;      # ghostty
26   esac
27 
28   if (( ${+terminfo[kcuu1]} )); then
29@@ -215,6 +218,7 @@ for keymap in emacs vicmd viins; do
30   case "$TERM_PROGRAM" in
31   Apple_Terminal) bindkey -M $keymap "^[[B" dirhistory_zle_dirhistory_down ;;  # Terminal.app
32   iTerm.app) bindkey -M $keymap "^[^[[B" dirhistory_zle_dirhistory_down ;;     # iTerm2
33+  ghostty) bindkey -M $keymap "^[[1;3B" dirhistory_zle_dirhistory_down ;;      # ghostty
34   esac
35 
36   if (( ${+terminfo[kcud1]} )); then