Skip to content

Consume extended CSI sequences atomically in PosixEventParser - #310

Open
shayann07 wants to merge 1 commit into
ajalt:masterfrom
shayann07:fix/csi-sequence-byte-leak
Open

shayann07 wants to merge 1 commit into
ajalt:masterfrom
shayann07:fix/csi-sequence-byte-leak

Conversation

@shayann07

Copy link
Copy Markdown

Extended CSI key sequences like Ghostty Shift+Enter leak unconsumed trailing bytes into the input stream, causing them to be emitted as separate keystrokes on subsequent reads. This happens because PosixEventParser used fixed-length digit loops and stopped parsing before reading the final terminator byte. We now consume all bytes of the CSI sequence until its terminator, map extended keycodes like Enter to their corresponding KeyboardEvent, and add regression tests.

Resolves #307

This branch has not been deployed

No deployments
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.

PosixEventParser leaks unconsumed bytes for extended CSI sequences, emitting wrong key events

1 participant