Skip to content

fix(input): decode kitty key events with event type suffix for all keys - #532

Open
adi-IL wants to merge 1 commit into
vercel-labs:mainfrom
adi-IL:fix/kitty-event-type-all-keys
Open

fix(input): decode kitty key events with event type suffix for all keys#532
adi-IL wants to merge 1 commit into
vercel-labs:mainfrom
adi-IL:fix/kitty-event-type-all-keys

Conversation

@adi-IL

@adi-IL adi-IL commented Aug 30, 2026

Copy link
Copy Markdown

When terminals implementing the Kitty progressive keyboard protocol report key events with an event-type suffix (such as press :1, repeat :2, or release :3 in ESC[<keycode>;<modifiers>:<event_type>u), the escape parser previously matched only keycode 27 (Escape).

As a result, colon-qualified event reports for other keys (such as Backspace 127, Enter 13, and Tab 9 emitted by terminals like Ghostty) were dropped as unhandled sequences.

This change:

  • Saves the keycode in param2 and packs modifiers in param across the : transition into kitty_escape_event_type_stage.
  • Resolves press (1), repeat (2), and unspecified (0) events through kittyUnicodeKeyAction for all keycodes.
  • Ignores release events (3) across all keycodes.
  • Adds test cases for Backspace, Enter, and Tab event types in src/ui/input/runtime.zig.

When terminals using the Kitty progressive keyboard protocol report key
events with an event-type suffix (such as press :1, repeat :2, or
release :3 in ESC[<keycode>;<modifiers>:<event_type>u), the parser
previously matched only keycode 27 (Escape).

As a result, colon-qualified event reports for other keys (such as
Backspace 127, Enter 13, and Tab 9 sent by terminals like Ghostty) were
dropped.

Generalize the event type decoding stage:
- Store the keycode in param2 and pack raw modifiers into the upper
  bits of param before transitioning to the event type stage.
- Dispatch press (1) and repeat (2) actions through kittyUnicodeKeyAction
  for all keycodes, while ignoring release events (3).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant