Severity: MEDIUM-HIGH Status: Fixed
Under the kitty keyboard protocol, CSI code;mods u emits a codepoint for every key — including special keys (Tab = 0x09, Enter = 0x0D, Escape = 0x1B, Backspace = 0x08). parseCsi returns these as .char:
// src/key.zig:143-176
'u' => {
const codepoint = std.fmt.parseInt(u32, codepoint_str, 10) catch return error.InvalidCsi;
// ...
return Key{ .char = .{ .code = @intCast(codepoint), .mod = k_mod } };
},
But keysEqual (in key_binding.zig) requires the active tags to match:
if (std.meta.activeTag(a) != std.meta.activeTag(b)) return false;
So a binding recorded as .special{ .key = .tab } can never equal a .char{ .code = 9 } key, even though they are the same physical key.
u final byte) is connected, user/Default bindings that target Tab/Enter/Escape as .special (or arrows/functions) silently fail to match.After parsing the codepoint in the u branch, normalize well-known codepoints to their Key variant before returning:
0x09 → .special{ .key = .tab }, 0x0D → .enter, 0x1B → .escape, 0x08 → .backspace,0x1B[A.., 0x1B[H.., F-key ranges) to .arrow/.function as appropriate, preserving mod.