Repository navigation
Harden TUI startup input handling - #38641
Merged
copyberry[bot] merged 1 commit intoAug 14, 2026
Merged
copyberry[bot] merged 1 commit into
copyberry[bot] merged 1 commit into
Conversation
## Why Terminal probes and other bootstrap work can leave keys or partial control sequences buffered before an interactive startup screen is visible. Those inputs must not accidentally select or confirm an action, while typeahead intended for the composer should survive terminal initialization. ## What changed - Replay user input consumed by Unix startup probes through Crossterm while filtering completed terminal color replies, and avoid consuming the Windows console input queue when detecting default colors. - Drain decoded and unread input after rendering actionable startup screens, including onboarding trust, migration, update, provider, resume, and hooks prompts. Keep incomplete control sequences quarantined and fail closed when an input boundary cannot be resolved. - Restore terminal modes if initialization exits early and bound terminal probe reads by time and byte limits. ## Testing Add parser, boundary, onboarding, and PTY coverage for preserved typeahead, split escape sequences, bracketed paste, delayed input, and fresh input after an interactive screen becomes ready. GitOrigin-RevId: 321198996cdd88fe9b43c4a762e750bff450482c
copyberry
Bot
force-pushed
the
copyberry/codex-internal-to-codex-oss/321198996cdd88fe9b43c4a762e750bff450482c
branch
from
August 14, 2026 20:25
0613c7c to
58d2dab
Compare
copyberry
Bot
deleted the
copyberry/codex-internal-to-codex-oss/321198996cdd88fe9b43c4a762e750bff450482c
branch
August 14, 2026 20:26
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Harden TUI startup input handling
Why
Terminal probes and other bootstrap work can leave keys or partial control
sequences buffered before an interactive startup screen is visible. Those
inputs must not accidentally select or confirm an action, while typeahead
intended for the composer should survive terminal initialization.
What changed
filtering completed terminal color replies, and avoid consuming the Windows
console input queue when detecting default colors.
including onboarding trust, migration, update, provider, resume, and hooks
prompts. Keep incomplete control sequences quarantined and fail closed when
an input boundary cannot be resolved.
reads by time and byte limits.
Testing
Add parser, boundary, onboarding, and PTY coverage for preserved typeahead,
split escape sequences, bracketed paste, delayed input, and fresh input after
an interactive screen becomes ready.