mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-25 04:55:58 +03:00
[GH-ISSUE #758] Unify stdin parsing: single parser for all escape sequence types #977
Labels
No labels
bug
core
documentation
feature
good first issue
help wanted
pull-request
question
react
solid
tmux
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/opentui#977
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @simonklee on GitHub (Mar 1, 2026).
Original GitHub issue: https://github.com/anomalyco/opentui/issues/758
Originally assigned to: @simonklee on GitHub.
stdinListenerinrenderer.tssplits stdin data into two mutually exclusive paths before parsing:This is an either/or dispatch at the chunk level. If a chunk starts with mouse sequences, the entire chunk is routed to Path A and any trailing non-mouse data (keyboard input, focus events, etc.) is silently dropped. If a chunk starts with non-mouse data, any mouse sequences later in the chunk go to Path B where
StdinBufferwill split them out but they won't reachMouseParser.This is the cause of #748, and other related issues when the OS joins different sequence types into the same
read()buffer.There are at least four independent parsers that don't coordinate:
MouseParser.parseAllMouseEvents(): parses SGR/X10 mouse from rawdata, only reached via Path A
StdinBuffer.extractCompleteSequences(): generic escape sequencesplitter that already understands CSI, OSC, DCS, APC, SS3, and even SGR mouse
boundaries. Only reached via Path B.
inputHandlerschain: capability responses, focus, theme mode handlersthat pattern-match on sequences after
StdinBufferemits themTerminalPalette: registers its ownstdin.on("data")listenerdirectly on stdin, completely outside the normal flow
Related:
@simonklee commented on GitHub (Mar 9, 2026):
Closed by #770