Repository navigation
core: remove the legacy stdin parser - #1981
Merged
Merged
Conversation
The TypeScript stdin parser was the default, and the native parser was opt-in through experimental_nativeInput or OTUI_NATIVE_INPUT_PARSER. Native is now the only parser. The option, both environment variables, the OTUI_NATIVE_INPUT_SHADOW comparator, stdinParserMaxBufferBytes and the StdinParser exports go with the TypeScript parser, 2,077 lines. Clock mode stays: a session that misses a DA1 reply still switches to it, so the 5 s backstop and the palette and theme timers remain. Tests that ran on the legacy parser by default now run on native. Four expectations follow native's deliberate differences: a UTF-8 lead byte waits for the rest of its character, motion with a held button is a drag, and a Kitty key code that is a control character is not a key. Issue: 044, 196, 197 Fixes #1634 Fixes #1635
With the native parser alone, the renderer's startupCursorCprActive updates never change the expectations: explicitWidthCprActive spans the same startup batch. Its kittyKeyboardEnabled writes have no effect, because the Session sets the Kitty expectation from the terminal on every feed. The clock-mode arm of suspend() is unreachable, since the startup batch's backstop always fires first. Remove them, and fix two docs pages and the conformance header that still described the five-second window and todo rows. A native row pins that a C1 Kitty key code is a reply, not a key.
This was referenced Nov 10, 2026
simonklee
added a commit
that referenced
this pull request
Nov 23, 2026
Since 0.9.0, apps in ConEmu draw with its 16-color palette, and mouse clicks do nothing while the wheel works. Colors: when a write ends with the ST of an APC or DCS, ConEmu holds it back, then drops it and two more bytes of the next write. Since #2056 the startup queries end with the Kitty graphics APC, and the next write is `ESC[s ESC[?1049h`. ConEmu loses the `ESC [` and never enters its alternate buffer, the only one where it draws 24-bit color. The batch now ends with its hide-cursor CSI. Clicks: ConEmu sends every SGR release as button 3. The native parser dropped those; the TypeScript parser removed in #1981 did not. Such a release now releases the held button. Checked on Windows 11 in ConEmu 230724, conhost and Windows Terminal, with a Core app and OpenCode 2.4.0. Lost clicks in conhost on older Windows 10 builds are a separate case that this does not fix. Refs anomalyco/opencode#65832, anomalyco/opencode#65894
Dicklesworthstone
pushed a commit
to Dicklesworthstone/opentui
that referenced
this pull request
Nov 23, 2026
…co#2200) Since 0.9.0, apps in ConEmu draw with its 16-color palette, and mouse clicks do nothing while the wheel works. Colors: when a write ends with the ST of an APC or DCS, ConEmu holds it back, then drops it and two more bytes of the next write. Since anomalyco#2056 the startup queries end with the Kitty graphics APC, and the next write is `ESC[s ESC[?1049h`. ConEmu loses the `ESC [` and never enters its alternate buffer, the only one where it draws 24-bit color. The batch now ends with its hide-cursor CSI. Clicks: ConEmu sends every SGR release as button 3. The native parser dropped those; the TypeScript parser removed in anomalyco#1981 did not. Such a release now releases the held button. Checked on Windows 11 in ConEmu 230724, conhost and Windows Terminal, with a Core app and OpenCode 2.4.0. Lost clicks in conhost on older Windows 10 builds are a separate case that this does not fix. Refs anomalyco/opencode#65832, anomalyco/opencode#65894 (cherry picked from commit 234ae0c)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The renderer parsed stdin with the TypeScript parser unless an app opted into the native one. OpenCode never did, so
it still ran the TypeScript parser. The native parser is now the only one.
Breaking changes:
experimental_nativeInputandOTUI_NATIVE_INPUT_PARSERare removed; input always uses the nativeparser.
stdinParserMaxBufferBytesis removed; the native parser bounds its own buffer.OTUI_NATIVE_INPUT_SHADOWisremoved; to report a parser bug, attach an
OTUI_STDIN_LOGcapture.StdinParser,StdinParserOptions,StdinParserProtocolContext,StdinEventandStdinResponseProtocolare removed with no replacement; userenderer.keyInput,prependInputHandlerorsubscribeOsc.Apps now get native's behavior: Alt with punctuation and non-ASCII keys, modified F3 after startup, and wheel and
held-button mouse reports decode correctly; a terminal reply split by a pause is no longer typed; startup, theme and
palette waits end at the terminal's DA1 reply instead of on timers. Once a terminal confirms the Kitty keyboard
protocol, an Escape that ends a read is the Escape key at once, without the 20 ms wait. A single eight-bit Meta byte
waits as the start of a UTF-8 character.
Tested with the Core suite on Bun and Node and the native, React, Solid, SSH, keymap and Rust suites.
Fixes #1634
Fixes #1635