Skip to content

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

Closed as duplicate

Description

@M0DR1SH

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.

Activity

  1. added
    CLIIssues related to the Codex CLI
    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal display
    windows-osIssues related to Codex on Windows systems
    on Apr 15, 2026
  2. github-actions commented on Apr 15, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  3. removed
    windows-osIssues related to Codex on Windows systems
    CLIIssues related to the Codex CLI
    on Apr 15, 2026
  4. LEON-gittech commented on Apr 16, 2026

    @LEON-gittech

    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.

  5. LEON-gittech commented on Apr 16, 2026

    @LEON-gittech

    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.

  6. LEON-gittech commented on Apr 27, 2026

    @LEON-gittech

    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?

  7. etraut-openai commented on Apr 27, 2026

    @etraut-openai
    Contributor

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

  8. LEON-gittech commented on Apr 27, 2026

    @LEON-gittech
    Image

    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.
  9. LEON-gittech commented on Apr 27, 2026

    @LEON-gittech
    Image

    This is the version after my fix.

  10. bowuL commented on Jun 9, 2026

    @bowuL
    图片 这是我修正后的版本。

    have they accept this PR?

  11. simfor99 commented on Jul 2, 2026

    @simfor99

    +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.

  12. etraut-openai commented on Oct 13, 2026

    @etraut-openai
    Contributor

    (response from codex)

    Closing as overlapping with #8782, which tracks better separation of user input and Codex replies. Your Windows/WSL styling suggestions remain useful linked evidence; broader theme configuration is also tracked in #21130.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displayenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions