CSI u parser drops the event-type field:-form releases rejected outrightSeverity: MEDIUM (input correctness, only when outer terminal sends kitty sequences)
Status: ✅ FIXED
Files: src/key.zig:143-180
The 'u' branch documents the kitty variants:
// events: CSI [>] code;modifiers;event u (event=1 press, 2 repeat, 3 release)
but only reads two fields:
const codepoint_str = it.first();
const k_mod: Modifier = if (it.next()) |mod_str| ... // modifiers
// third field (event type) never read
Consequences when an outer terminal sends event types (kitty progressive-enhancement flags negotiated, or terminals configured to always disambiguate):
CSI code;mods;3u (release): the third field is silently dropped → the release is processed as a key press (phantom input; breaks hold-to-repeat and key-up handling in panes).CSI code;mods:3u (the spec’s : separator): parseInt(u8, "1:3") fails → error.InvalidCsi → the key is dropped entirely.Note the client never requests kitty flags from the outer terminal, so this only bites when the outer terminal emits these sequences uninvited — but the parser explicitly claims to handle the events variant, so the gap is real.
Read the third field; drop event type 3 (release), pass through 1 (press), and make an explicit decision on 2 (repeat — likely pass through, matching xterm autorepeat behavior). Handle both ; and : separators per the kitty spec. Regression tests: CSI 97;1:3u must not produce a press.
In src/key.zig, the Kitty CSI u parser parses event types from both :-delimited modifier subparameters (modifiers:event-type) and third ;-delimited fields (code;modifiers;event). Release events (event_type == 3) return error.IgnoredEvent (which tty_key.zig cleanly drops as non-events), repeat events (event_type == 2) pass through as presses, and colon-delimited alternate keycodes (code:alternate) are supported by taking the base codepoint.
Tests: parse kitty event types and colon sub-parameters — bug #489 validates that presses pass through, repeats pass through, and releases (1:3u and 1;3u) return error.IgnoredEvent.