Files
codex/codex-rs/tui/tests/suite
Eric Traut 9f2cbb9c09 Discard TUI typeahead after prompt rewind and fork (#63193)
## Why

Rewinding to edit an earlier prompt restores it in the composer. If a
second rewind gesture is already buffered, its Enter can submit the
restored prompt before the user edits it. [Prompt rewind behavior](https://github.com/openai/codex/pull/45845)

## What changed

Pause terminal input as soon as a rewind is queued. Drain buffered input
before showing the restored prompt, and use the same drain after forks
from a locked thread or the agents overview. Retry in bounded batches
while input is still pending, deliver buffered focus changes in order,
and recheck terminal size when the drain finishes.

## Testing

Extend PTY coverage to verify that repeated rewind keystrokes and a
trailing Escape leave the restored prompt ready for a fresh edit and
submission. Cover delayed paste completion, focus event ordering,
and terminal resize during a drain.

GitOrigin-RevId: 65ba4f343892ed3ba2eeb120172f66bfbebe120f
2026-11-22 21:18:40 +00:00
..