Files
codex/codex-rs/tui/tests
Felipe Coury fc8cd2442b Refresh TUI terminal colors after returning from an external editor (#65221)
## Why

The TUI caches the terminal's default colors at startup. If the terminal
switches from dark to light while an external editor is open, the composer
can still use the old background tint when Codex regains control.

## What changed

- On supported local Kitty, Ghostty, and Rex sessions, query the default
  foreground and background through the TUI input stream after returning
  from the editor. Redraw when the reported colors change.
- Drain pending terminal reports before opening the editor, suspending, or
  exiting. If the drain times out before an editor handoff or suspension,
  keep the TUI active, preserve input, and show an error.

## Testing

Add pseudo-terminal tests for the updated composer tint, stale Enter
handling on editor handoff, and draft preservation and report draining
after editor and suspend timeouts.

GitOrigin-RevId: 7f438a7df26d602bf975695c27a9f431432d16cf
2026-12-02 10:36:43 +00:00
..