aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-26 09:31:15 -0400
committerCraig Jennings <c@cjennings.net>2026-06-26 09:31:15 -0400
commit61ad680be913f882008babec6c4e6ce89fb0ed6f (patch)
tree11c81a22b856c07fa6e0af80fa319548fab4026f /tests
parent9e9b2aa83bfddb35c0f6eb99b7c89677798983d3 (diff)
downloaddotemacs-61ad680be913f882008babec6c4e6ce89fb0ed6f.tar.gz
dotemacs-61ad680be913f882008babec6c4e6ce89fb0ed6f.zip
fix(eat): forward word-motion arrows to the terminal in agent buffers
C-/M-left/right were in EAT's default eat-semi-char-non-bound-keys, so they fell through to Emacs and ran left-word/right-word, moving point in the EAT buffer instead of being sent to the program. The terminal's own cursor never moved, so the next keystroke snapped point back to the real cursor -- the "cursor jumps back" symptom when editing claude's input. Bind them to eat-self-input so they forward as word motion, the way ghostel did. Window arrows (S-, C-M-) still reach Emacs for windmove and buffer-move.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-term-tmux-history.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test-term-tmux-history.el b/tests/test-term-tmux-history.el
index c7154e5d..1dbf6b0b 100644
--- a/tests/test-term-tmux-history.el
+++ b/tests/test-term-tmux-history.el
@@ -288,5 +288,13 @@ returns to semi-char from EAT's emacs/char mode -- one exit key for both."
(cj/term-send-escape)
(should (equal sent '("\e"))))))
+(ert-deftest test-term-word-motion-arrows-forwarded-not-window-arrows ()
+ "Normal: C-/M-left/right forward to the terminal (word motion in the program's
+input) instead of moving Emacs point; windmove's S-arrows still reach Emacs."
+ (dolist (key '("C-<left>" "C-<right>" "M-<left>" "M-<right>"))
+ (should (eq (keymap-lookup eat-semi-char-mode-map key) #'eat-self-input)))
+ (dolist (key '("S-<left>" "S-<right>"))
+ (should-not (eq (keymap-lookup eat-semi-char-mode-map key) #'eat-self-input))))
+
(provide 'test-term-tmux-history)
;;; test-term-tmux-history.el ends here