fix: Buffer stdin before prompt UI appears#24412
Open
DSteve595 wants to merge 1 commit intoanomalyco:devfrom
Open
fix: Buffer stdin before prompt UI appears#24412DSteve595 wants to merge 1 commit intoanomalyco:devfrom
DSteve595 wants to merge 1 commit intoanomalyco:devfrom
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate FoundPR #20934: feat: buffer stdin during TUI startup so early input is preserved Why it's related: PR #24412 explicitly mentions that it "takes a different approach to #20934". Both PRs address the same issue (#14415) - preventing characters from being dropped while typing between launching opencode and the prompt UI being rendered. The main difference is that PR #24412 leverages OpenTUI's StdinParser instead of custom parsing logic. Additional related PR: This is also stdin-related but appears to address cleanup rather than input buffering during startup. |
This was referenced Apr 26, 2026
Bojun-Vvibe
added a commit
to Bojun-Vvibe/oss-contributions
that referenced
this pull request
Apr 26, 2026
- anomalyco/opencode#24411: structured-vs-string reasoning_details split for Kilo - anomalyco/opencode#24412: startup-stdin side-buffer drain into TUI prompt - openai/codex#19620: AsciiJsonFormatter for HTTP turn-metadata headers
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.
Issue for this PR
Closes #14415
Type of change
What does this PR do?
This addresses chars being dropped while typing between launching opencode and the prompt UI being rendered, by buffering stdin and seeding the prompt state with it later.
This takes a different approach to #20934, leveraging OpenTUI's StdinParser rather than parsing the input ourselves.
I attempted to address @TZubiri's concern, but couldn't find a subtractive solution that worked. That said, I'm not well versed in OpenTUI. It seems to take stdin ownership and set it to raw mode immediately in
createCliRenderer(). I tried in a small repro project that delays before rendering a text box, and input was swallowed there too.How did you verify your code works?
Manual testing on macOS 26's stock Terminal.app.
Screenshots / recordings
Screen.Recording.2026-04-25.at.5.37.57.PM.mov
Screen.Recording.2026-04-25.at.5.38.24.PM.mov
Checklist