Skip to content

[medium] keymap: prefix-match single-keystroke bindings (batched-read miss) #445

Description

@fentas

Split out from #419.

keymap.match (src/keymap.zig ~283) requires a whole-read byte-exact std.mem.eql(input, bind.bytes). When a keystroke is batched with other bytes in one read (fast typing, paste, a mouse burst trailing a keystroke), the binding silently doesn't fire and the raw bytes flow to the shell — latency-sensitive for Right/End ghost-accept.

Fix: prefix-match the single-keystroke action set against the head of input and consume the matched prefix. Needs care to avoid regressions where a binding's bytes are a prefix of a longer distinct sequence; scope to the single-keystroke bindings and verify against the kitty-kbd CSI-u forms. Deferred from #419 (the line_state split-CSI fix landed there) as a separate, higher-risk change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    audit-trackedFiled from a self-review audit; future reviews should skipbugSomething isn't workingmedium-priorityMedium-severity audit finding

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions