Files
codex/codex-rs/tui
Felipe Coury 3a3b34c74a Refresh TUI colors on terminal theme changes and focus regain (#65238)
## Why

A terminal theme change could leave the composer using stale colors until
Codex returned from an external editor.

## What changed

On supported Unix terminals, enable live color reporting after startup
prompts have cleared and only when the terminal reports that the mode is
off. Refresh the default foreground and background on theme notifications
and when the terminal regains focus. Read color replies through the same
event stream as keyboard input and redraw when the colors change.

Release the subscription before handing the terminal to an external editor
and check whether it can be re-enabled when Codex resumes.

## Testing

PTY tests cover idle composer redraws, focus refresh without a theme
notification, existing subscriptions, and recovery after missing replies.
They also cover Escape, typing, and interrupt keys during color queries.

GitOrigin-RevId: 0f0d4b057fdc7c2d6813dc08ff284f47824db6b0
2026-12-02 11:39:41 +00:00
..