aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/term-config.el7
-rw-r--r--tests/test-term-tmux-history.el11
2 files changed, 16 insertions, 2 deletions
diff --git a/modules/term-config.el b/modules/term-config.el
index 5753edde..7cd386dc 100644
--- a/modules/term-config.el
+++ b/modules/term-config.el
@@ -229,9 +229,12 @@ run its own project-named tmux session instead of a bare, auto-named one.
;; rebuild is what actually lets the key through to `ghostel-mode-map' / the
;; global map. C-; and F12 are the prefix + toggle; the modified arrows are
;; windmove (S-arrows, focus) and buffer-move (C-M-arrows, swap), which the
- ;; ai-term workflow expects to work from inside an agent buffer.
+ ;; ai-term workflow expects to work from inside an agent buffer. F10 and
+ ;; C-F10 are global bindings (music-playlist toggle, server shutdown) that
+ ;; reach Emacs by falling through to the global map once the semi-char map
+ ;; stops forwarding them.
(with-eval-after-load 'ghostel
- (dolist (key '("C-;" "<f12>"
+ (dolist (key '("C-;" "<f12>" "<f10>" "C-<f10>"
"S-<up>" "S-<down>" "S-<left>" "S-<right>"
"C-M-<up>" "C-M-<down>" "C-M-<left>" "C-M-<right>"))
(add-to-list 'ghostel-keymap-exceptions key))
diff --git a/tests/test-term-tmux-history.el b/tests/test-term-tmux-history.el
index 1bb7e73b..b7ab5351 100644
--- a/tests/test-term-tmux-history.el
+++ b/tests/test-term-tmux-history.el
@@ -327,6 +327,17 @@ instead of being forwarded to the terminal program."
(should-not (eq (keymap-lookup ghostel-semi-char-mode-map "C-M-<left>")
'ghostel--send-event)))
+(ert-deftest test-term-f10-music-and-shutdown-in-keymap-exceptions ()
+ "Regression: F10 (music playlist toggle) and C-F10 (server shutdown) are in
+`ghostel-keymap-exceptions' so they reach Emacs from inside a ghostel buffer
+instead of being forwarded to the terminal program. Both are global bindings,
+so dropping them from the semi-char map lets the lookup fall through to the
+global map."
+ (dolist (key '("<f10>" "C-<f10>"))
+ (should (member key ghostel-keymap-exceptions)))
+ (should-not (eq (keymap-lookup ghostel-semi-char-mode-map "<f10>")
+ 'ghostel--send-event)))
+
(ert-deftest test-term-c-spc-forwarded-not-set-mark ()
"Regression: C-SPC is forwarded to the terminal, not bound to the global
`set-mark-command'. ghostel only forwards the `C-@' event, so without this an