You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Modified character keys bypass the kitty keyboard protocol: M-<letter> sends legacy ESC, C-M-<letter> drops meta #579
When the running program has enabled the kitty keyboard protocol, ghostel
still encodes modified character keys with legacy sequences: M-<letter>
goes out as ESC <letter> (which kitty-mode programs reject as ambiguous
instead of reading as alt), and C-M-<letter> is sent as the bare control
byte — the meta modifier is silently dropped. Modified functional keys
(backspace, return, arrows) encode correctly as CSI-u.
In practice this makes alt-key bindings dead in semi-char mode for any
kitty-negotiating TUI (pi, Claude Code, kkp-enabled apps): M-b/M-f/M-d
word motion, C-M-<letter> chords, etc.
Steps to reproduce
M-x ghostel, then run: printf '\e[>1u'; cat -v (push the kitty
disambiguate flag and capture input bytes).
Press M-t → cat shows ^[t. Expected under kitty: ^[[116;3u.
Press M-<backspace> → shows ^[[127;3u — correct, demonstrating the
functional-key path already does the right thing.
Same results via ghostel-send-key ("t" "meta" / "s" "ctrl,meta").
Root cause
The native encoder produces no output for these keys, so ghostel--send-encoded falls back to ghostel--raw-key-sequence
(lisp/ghostel.el:1578). That function's character-key branches are
kitty-unaware: the ctrl branch matches first and emits char & 0x1f
(dropping any meta bit), and the meta+printable branch always emits ESC <char>. Its special-key branches, by contrast, emit CSI-u for
modified variants — hence backspace/return/arrows working.
Suggested fix
When the terminal has kitty flags active, emit CSI-u for modified
character keys too (mirroring the existing special-key branches), keeping
the current legacy sequences for non-kitty programs.
Activity
Encode modified character keys through the kitty keyboard protocol
Encode modified character keys through the kitty keyboard protocol
dakra commentedon Jul 29, 2026
Should be fixed in the latest release.