Composer text becomes unreadable after live terminal theme switch
## Repro
- Start Codex TUI in a terminal with a dark theme.
- Type in the composer.
- Switch the terminal to a light theme without restarting Codex.
- Return focus to Codex and keep typing.
## Actual
Composer input becomes nearly invisible, effectively white/light text on a white/light background.
## Expected
Composer text should stay readable after a terminal theme change.
## Suspected cause
The composer background is recomputed from terminal colors, but textarea text is rendered with default/inherited cell styling. After a dark -> light theme switch, stale
foreground styling can remain while the background updates, leaving the input white-on-white.
## Relevant files
codex-rs/tui/src/bottom_pane/chat_composer.rscodex-rs/tui/src/bottom_pane/textarea.rscodex-rs/tui/src/tui/event_stream.rs
Before switch:
<img width="2557" height="702" alt="Image" src="https://github.com/user-attachments/assets/4cdae374-f963-41c5-8b6c-8dac98093eb1" />
After:
<img width="2557" height="702" alt="Image" src="https://github.com/user-attachments/assets/39a368a8-48b0-49f5-bce7-ecd55b05a1c7" />
Same after dark to light switches
# Evidence:
- Composer background uses
user_message_style():
<https://github.com/openai/codex/blob/main/codex-rs/tui/src/bottom_pane/chat_composer.rs#L4380>
<https://github.com/openai/codex/blob/main/codex-rs/tui/src/style.rs#L8>
- Typed text uses plain
Style::default():
<https://github.com/openai/codex/blob/main/codex-rs/tui/src/bottom_pane/textarea.rs#L1373>
- Palette refresh only happens on
FocusGained:
<https://github.com/openai/codex/blob/main/codex-rs/tui/src/tui/event_stream.rs#L249>
- Style guide warning about white/black assumptions:
<https://github.com/openai/codex/blob/main/codex-rs/tui/styles.md#L17>
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗