Skip to content

stdin parser: CSI timeout flush drops split escape sequences #818

@Hona

Description

@Hona

When a CSI sequence (e.g. kitty keyboard ESC[118;5;3u) gets split across two stdin reads, the 10ms timeout flushes the incomplete prefix as an opaque "unknown" response instead of waiting for the final byte.

The timeout exists to detect lone ESC keypresses, but once we're in CSI state (ESC[ already seen), the sequence is unambiguous. We should keep waiting for the final byte rather than flushing on timeout.

This causes flaky input on Windows Terminal Preview where kitty key release events arrive split across reads.

Fix: Don't honor forceFlush in csi state in scanPending(). The sequence will either complete on the next read or get interrupted by a new ESC (already handled). Same applies to osc/dcs/apc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions