diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test-ai-term--f9-in-term.el | 11 | ||||
| -rw-r--r-- | tests/test-term-tmux-history.el | 9 |
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/test-ai-term--f9-in-term.el b/tests/test-ai-term--f9-in-term.el index 53e1c4e7..dad11ffc 100644 --- a/tests/test-ai-term--f9-in-term.el +++ b/tests/test-ai-term--f9-in-term.el @@ -41,5 +41,16 @@ agent; `M-<f9>' and `C-S-<f9>' close an agent via `cj/ai-term-close'." (should (eq (lookup-key (current-global-map) (kbd "M-<f9>")) #'cj/ai-term-close)) (should (eq (lookup-key (current-global-map) (kbd "C-S-<f9>")) #'cj/ai-term-close))) +(ert-deftest test-ai-term-f9-family-in-keymap-exceptions () + "Regression: the F9 family is in `ghostel-keymap-exceptions' so semi-char +mode lets it reach Emacs instead of forwarding it to the terminal program. +Binding in `ghostel-mode-map' alone is not enough -- the semi-char map outranks +it and forwards any key not in the exceptions to the pty." + (dolist (key '("<f9>" "C-<f9>" "M-<f9>" "C-S-<f9>")) + (should (member key ghostel-keymap-exceptions))) + ;; The rebuilt semi-char map must no longer forward <f9> to the pty. + (should-not (eq (keymap-lookup ghostel-semi-char-mode-map "<f9>") + 'ghostel--send-event))) + (provide 'test-ai-term--f9-in-term) ;;; test-ai-term--f9-in-term.el ends here diff --git a/tests/test-term-tmux-history.el b/tests/test-term-tmux-history.el index 2c9c38f8..49296b42 100644 --- a/tests/test-term-tmux-history.el +++ b/tests/test-term-tmux-history.el @@ -308,5 +308,14 @@ its own copy-mode against the full pane history." (when (buffer-live-p agent) (kill-buffer agent))))) +(ert-deftest test-term-prefix-and-f12-in-keymap-exceptions () + "Regression: C-; and F12 are in `ghostel-keymap-exceptions' and the rebuilt +semi-char map no longer forwards them to the pty, so the prefix keymap and the +F12 toggle reach Emacs inside ghostel buffers." + (dolist (key '("C-;" "<f12>")) + (should (member key ghostel-keymap-exceptions))) + (should-not (eq (keymap-lookup ghostel-semi-char-mode-map "<f12>") + 'ghostel--send-event))) + (provide 'test-term-tmux-history) ;;; test-term-tmux-history.el ends here |
