diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-05 05:43:43 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-05 05:43:43 -0500 |
| commit | 854aa53a96476ccaae0c93bd9af0493ef8431e4b (patch) | |
| tree | a102ae33bbe0341819df900228460263ee83b6c2 /docs | |
| parent | ebdf9e466b0e1f86e9b7d76650ac32408273e7a7 (diff) | |
| download | dotemacs-854aa53a96476ccaae0c93bd9af0493ef8431e4b.tar.gz dotemacs-854aa53a96476ccaae0c93bd9af0493ef8431e4b.zip | |
fix(term): make F9 and F12 reach Emacs inside ghostel buffers
F9 did nothing in an agent buffer: ghostel's semi-char mode forwards every key not in ghostel-keymap-exceptions to the pty, and ghostel-semi-char-mode-map outranks the major-mode map, so the F9-family and F12 bindings I'd put in ghostel-mode-map never fired. The keys went to Claude/the shell, which ignored them.
I added the F9 family (in ai-term) and F12 plus C-; (in term-config) to ghostel-keymap-exceptions and rebuilt the semi-char map with ghostel--rebuild-semi-char-keymap. add-to-list updates the list but not the already-built map, so the rebuild is what actually lets the keys through. C-; had the same latent bug for the same reason.
Two regression tests assert the keys are in the exceptions and that the rebuilt semi-char map no longer forwards them. I also corrected the spec note that claimed binding in ghostel-mode-map was enough (true for vterm, wrong for ghostel) and codified the gotcha.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/design/vterm-to-ghostel-migration-spec.org | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/docs/design/vterm-to-ghostel-migration-spec.org b/docs/design/vterm-to-ghostel-migration-spec.org index b7d61e23..5974445a 100644 --- a/docs/design/vterm-to-ghostel-migration-spec.org +++ b/docs/design/vterm-to-ghostel-migration-spec.org @@ -53,9 +53,14 @@ in the real config. Emacs 30.2 GTK, x86_64, modules supported. - *F8 / key forwarding (diagnostic)*: ghostel's default semi-char mode forwards unlisted keys to the terminal program; only =ghostel-keymap-exceptions= (default =C-c C-x C-u C-h M-x M-: C-\=) reach - Emacs. This is why F-key bindings (F9 family, F12) must be installed in - =ghostel-mode-map= for terminal buffers, exactly as the current config does - for =vterm-mode-map=. + Emacs. Unlike vterm, binding F9/F12 in =ghostel-mode-map= is NOT enough: + =ghostel-semi-char-mode-map= is rebuilt from =ghostel-keymap-exceptions= and + outranks the major-mode map, so a key not in the exceptions is sent to the + pty before the mode-map binding can fire. The F9 family, F12, and C-; must be + added to =ghostel-keymap-exceptions= AND the semi-char map rebuilt + (=ghostel--rebuild-semi-char-keymap=; =add-to-list= alone updates the list + but not the already-built map). (Shipped wrong in the first cut — F9 did + nothing in agent buffers until the keys were added to the exceptions.) - *GUI / TTY visual*: Craig confirmed the Claude Code TUI and a TTY frame both render great. dupre chrome applies; the 16 ANSI terminal faces are ghostel defaults (dupre does not theme them) — Decision D2. |
