TUI: allow distinct styling/colors for user and assistant messages

Open 💬 9 comments Opened Apr 15, 2026 by M0DR1SH
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What variant of Codex are you using?

Windows 11 - PowerShell 7.6.0 - Codex CLI in terminal mode

What feature would you like to see?

In Codex CLI, user prompts and assistant responses are currently rendered with very little visual distinction in the
main conversation flow.

At the moment, this makes long sessions harder to scan, especially when looking back through a discussion to find a
previous user instruction.

Additional information

### Current behavior

  • User and assistant messages appear with nearly the same color/styling
  • The only distinction is a very small prefix marker
  • Theme settings seem to affect diff blocks, but not the main user/assistant message styling
  • Changing the terminal color scheme does not solve the issue if Codex renders both roles similarly

### Expected behavior

It would be helpful to have stronger visual separation between:

  • user messages
  • assistant messages

### Possible solutions

Any of the following would help:

  • distinct colors for user vs assistant messages
  • configurable role-based styling in the TUI theme
  • stronger prefixes or labels for each role
  • optional background contrast or border styling per role

### Why this matters

In long conversations, readability and navigation degrade quickly when both sides of the conversation look almost
identical. Better role separation would make the TUI much easier to use for iterative work.

View original on GitHub ↗

9 Comments

github-actions[bot] contributor · 3 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #17144
  • #16208

Powered by Codex Action

LEON-gittech · 3 months ago

I’m seeing the same problem specifically in dark mode on Codex CLI.

In long transcript-heavy sessions, user prompts and assistant responses are still too visually similar in the main conversation flow. The tiny prefix marker is not enough to make prior user instructions easy to scan for.

A few clarifications from my setup and testing:

  • this is in dark mode, not a light-theme issue
  • changing the terminal color scheme alone does not solve it if Codex keeps both roles styled too similarly
  • the problem is in the main transcript, not just diff views, subagent labels, or the composer

From a usability standpoint, even a minimal improvement would help a lot:

  • stronger user-message background contrast
  • distinct role labels or prefixes
  • optional role-based styling in the TUI theme
  • any non-color structural cue (border/left rule/badge) so the distinction survives across terminal themes

I looked through related issues/PRs and found fixes for light-mode user backgrounds and other contrast issues, but I haven’t found a merged fix that fully addresses dark-mode user vs assistant separation in the main transcript.

LEON-gittech · 3 months ago

I dug into this locally and implemented a small focused version of the change in a fork.

What I changed:

  • strengthened the dark-theme user-message background blend in codex-rs/tui/src/style.rs
  • added an explicit fallback background when default_bg() is unavailable instead of falling back to Style::default()
  • updated UserHistoryCell in codex-rs/tui/src/history_cell.rs to render a clearer User › prefix instead of the dim single-chevron marker
  • updated the affected transcript snapshot and added focused test coverage

Validated locally with:

  • cargo test -p codex-tui missing_terminal_bg_uses_explicit_fallback_panel -- --nocapture
  • cargo test -p codex-tui user_history_cell_wraps_and_prefixes_each_line_snapshot -- --nocapture

I also pushed the branch to my fork here:

  • LEON-gittech/codex:fix/user-message-contrast-codex-dev

I noticed docs/contributing.md says external PRs are invitation-only, so I’m not going to open an unsolicited PR. But if the Codex team thinks this narrow approach is aligned with the intended solution, I’d be happy to submit the PR by invitation.

LEON-gittech · 2 months ago

We ran into the same readability problem and implemented a local fix that addresses most of the points raised here without adding full theme configurability yet:

What we changed in "Improve user message contrast in the TUI transcript" ():

  1. Stronger prefix / label — changed the user-message prefix from a tiny dim to explicit in bold cyan. This makes user messages immediately scannable.
  2. Background contrast fallback — when terminal background detection fails (common under terminal multiplexers like Zellij), we now fall back to background instead of no background at all ().
  3. Darker alpha blend — increased the dark-terminal alpha from to so the subtle background tint is actually visible on dark themes.
  4. Consistent padding — aligned the assistant-message indentation to match the new user prefix width so the transcript stays visually balanced.

Trade-offs:

  • No new theme/config keys added (keeps the change small).
  • The cyan prefix is hard-coded; users who want full configurability would still need the "configurable role-based styling" feature mentioned in this issue.

Would the maintainers be open to a PR that upstreams these specific contrast improvements as an interim step before a full theming system?

etraut-openai contributor · 2 months ago

@LEON-gittech, I'd be interested in seeing a screen shot.

LEON-gittech · 2 months ago

<img width="1426" height="606" alt="Image" src="https://github.com/user-attachments/assets/723a40f3-a2c0-4318-8094-faf5588f8b32" />

Here is a screenshot from a typical Zellij session.

Environment:

  • Zellij: 0.43.1
  • Codex CLI: 0.124.0

The screenshot shows two related readability issues:

  1. The chat input box has very little background contrast, so it does not stand out clearly from the surrounding TUI.
  2. In the conversation history, user queries are hard to distinguish from assistant responses, which makes long sessions difficult to scan.
LEON-gittech · 2 months ago

<img width="1129" height="402" alt="Image" src="https://github.com/user-attachments/assets/dd079881-58b0-4c28-9e3d-16d2a0ed390e" />

This is the version after my fix.

bowuL · 1 month ago
<img alt="图片" width="1129" height="402" src="https://private-user-images.githubusercontent.com/71886344/584025229-dd079881-58b0-4c28-9e3d-16d2a0ed390e.jpg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODA5ODU3NzEsIm5iZiI6MTc4MDk4NTQ3MSwicGF0aCI6Ii83MTg4NjM0NC81ODQwMjUyMjktZGQwNzk4ODEtNThiMC00YzI4LTllM2QtMTZkMmEwZWQzOTBlLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA2MDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNjA5VDA2MTExMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRkMGVjYjY4NjQ2MTBjNTBjZjdiMjgwMWRhNjA1OGRmN2U4MjY4MWU2YTdhNjY2NTllNThiZjc2NTU1NjhlZGMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRmpwZWcifQ.xNlVR4egG7HeDj5OT1CwO1lLiW-jTouN8S5-OpxX4bc"> 这是我修正后的版本。

have they accept this PR?

simfor99 · 18 days ago

+1 for making user/assistant transcript styling configurable in the CLI TUI.

Use case: long Codex CLI sessions on Windows Terminal / WSL Ubuntu profile. The current gray user-message block is helpful, but it is still not visually distinct enough in dense transcript-heavy sessions. It would be much easier to scan if users could configure role-based styling, for example:

[tui.role_styles.user]
background = "#264F78"
foreground = "#FFFFFF"
border = "#264F78"
label = "User"

[tui.role_styles.assistant]
background = "default"

Terminal selection color can be configured separately in Windows Terminal, but transcript user-message blocks are rendered by Codex itself, so terminal profile settings cannot solve this.

A minimal version would already help: stronger user-message background contrast, a configurable user-message accent/border, or an explicit role label/prefix that survives dark terminal themes.