Skip to content

Harden TUI startup input handling - #38641

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/321198996cdd88fe9b43c4a762e750bff450482c
Aug 14, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/321198996cdd88fe9b43c4a762e750bff450482c

Conversation

@copyberry

@copyberry copyberry Bot commented Aug 14, 2026 •

Copy link
Copy Markdown

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

  • 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.

## 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
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/321198996cdd88fe9b43c4a762e750bff450482c branch from 0613c7c to 58d2dab Compare August 14, 2026 20:25
@copyberry
copyberry Bot merged commit 58d2dab into main Aug 14, 2026
26 of 30 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/321198996cdd88fe9b43c4a762e750bff450482c branch August 14, 2026 20:26
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant