Skip to content

Allow configuring semantic TUI colors beyond syntax highlighting #21130

Open

Description

@JiangHe12

What problem does this solve?

The current Codex CLI theme support appears to affect syntax highlighting, but it does not let users configure the main TUI text and semantic UI colors.

In my setup, Codex CLI's primary chat text is rendered using the terminal default foreground. That makes large parts of the TUI appear as plain black text in my PowerShell 7 / Windows environment, even when my terminal profile uses a colorful palette. In contrast, Claude Code uses more semantic colors across its terminal UI, so the interface has much better contrast and is easier to scan.

This is not primarily about code syntax highlighting. It is about the main terminal UI: chat text, assistant/user sections, secondary/dim text, borders, status line, input/composer area, selections, and other non-code UI elements.

Environment

  • Codex CLI: 0.128.0
  • OS: Windows
  • Shell: PowerShell 7.6.1
  • Installation: npm global package @openai/codex
  • Config currently contains:
[tui]
theme = "github"

Changing tui.theme or using /theme does not address the main TUI foreground/contrast issue, because the setting is focused on syntax highlighting.

Current behavior

  • Primary TUI text mostly uses the terminal default foreground.
  • tui.theme / /theme changes syntax highlighting, but not the broader TUI color system.
  • Users cannot configure semantic colors for the main TUI.
  • Users who want a higher-contrast, more colorful UI similar to Claude Code or Gemini CLI have to either patch Codex source locally or change global terminal defaults, which is too coarse.

Requested behavior

Please add first-class configuration for semantic TUI colors beyond syntax highlighting.

A minimal version could be something like:

[tui.colors]
foreground = "#E6EDF3"
muted = "#8B949E"
accent = "#58A6FF"
assistant = "#C084FC"
user = "#39D353"
success = "#3FB950"
warning = "#D29922"
error = "#F85149"
border = "#30363D"
status = "#79C0FF"
selection_fg = "#FFFFFF"
selection_bg = "#264F78"

Or, if a larger design is preferred:

  • Add built-in UI themes such as dark, light, high-contrast, ansi, etc.
  • Let users select them through /theme or config.
  • Support custom theme files with semantic slots for the non-code TUI.
  • Keep syntax highlighting themes separate from UI themes, or expose both clearly.

Why terminal colors alone are not enough

Terminal color schemes are still useful, but they cannot solve this fully because Codex currently chooses where to use default, dim, cyan, green, red, magenta, etc. A user can change the terminal palette, but cannot tell Codex that primary text, muted text, borders, composer text, and role labels should use different semantic colors.

This is especially noticeable when comparing Codex CLI to Claude Code: Claude Code's terminal UI uses more intentional semantic coloring, which gives better contrast and scanability without requiring global terminal changes.

Related context

Activity

  1. added
    enhancement
    CLI
    windows-os
    TUI
    config
    on May 5, 2026
  2. removed
    CLI
    windows-os
    config
    on May 5, 2026
  3. sscalpone commented on Jun 30, 2026

    @sscalpone

    Codex CLI 0.142.4 in iTerm2 uses ANSI Cyan for important prompt/banner text. In my terminal theme, that color has insufficient contrast. Changing iTerm2’s ANSI Cyan makes Codex readable but incorrectly changes cyan for every other terminal application. Please provide a configurable TUI accent/highlight color independent of the terminal’s ANSI palette.

    Codex provided the above text in a hard-to-read green.

    Codex ought to learn how to convey information without using colors.

  4. midgramr commented on Sep 28, 2026

    @midgramr

    A new update (0.155 -> 0.158) also made it so that a bright blue is hardcoded as the highlight color, rather than being resolved from the terminal colors.

    Image
  5. rm0nroe commented on Oct 6, 2026

    @rm0nroe

    +1. we patched this into a local codex build for a custom terminal setup, behind an env flag so standard mode stays as is. the slots that mattered past syntax: body text, secondary text (menu descriptions, help, status line), accent, the user message marker, user message text and background, and one surface color shared by the composer and code blocks. with those set, the transcript, composer and slash/model/theme menus all read fine on a dark background.

    two things that might save time if this gets built. history lines let the line style override span colors, so a semantic color on a span gets lost unless that precedence flips (we flip it only in our mode). and code block backgrounds have to apply while the answer streams, not just once the cell is finalized, or the block jumps when it completes.

    also, tui.theme is global, so a dark-tuned syntax theme makes identifiers near invisible on a light terminal; that's why we kept ours opt-in. picking a theme per light/dark appearance would cover it, related to #12840.

  6. rjsoux commented on Oct 27, 2026

    @rjsoux

    Adding a concrete use case for independent foreground/background overrides for the composer and submitted user messages, rather than a change to the default theme.

    Environment and problem

    I use the official Codex CLI 0.164.0 on Linux, inside tmux 3.4, accessed from iTerm2 on macOS. The input area already has a slightly different gray background, but the distinction is too subtle for me to immediately separate my contributions from assistant output.

    This affects both:

    • the composer while I am typing;
    • my submitted messages when scanning a long transcript.

    This is a legibility/accessibility request, not a claim that background detection is broken or that the panel is completely missing. I need a much stronger distinction without changing the entire terminal palette, maintaining a fork, or recompiling Codex.

    Requested behavior

    Please allow the foreground and background of those two surfaces to be configured independently of assistant output and code syntax highlighting.

    For example, I would like:

    Surface Background Text
    Composer/input area White (#FFFFFF) Black (#000000)
    Submitted user messages White (#FFFFFF) Black (#000000)
    Assistant output and the rest of the terminal Unchanged Unchanged

    These are example preferences, not proposed new defaults. Other users should be able to choose different colors, and composer and transcript settings should be independently overridable.

    Useful acceptance criteria

    1. Opt-in and backward-compatible: leaving the overrides unset preserves the existing appearance; removing them restores it.
    2. Both foreground and background: changing only the panel background must not leave inherited light text unreadable. The background should cover the complete wrapped/multiline user surface, not just characters.
    3. Readable interaction states: caret, selection, placeholder text, and role markers remain distinguishable with a high-contrast combination. Keep non-color cues for who is speaking.
    4. Terminal compatibility: explicit overrides should work through tmux/SSH, without depending on a successful automatic background-color probe; unsupported colors should degrade predictably according to terminal capabilities.
    5. Documented official configuration: include a minimal high-contrast example and validation for invalid values. The exact configuration names/theme format can follow the maintainers' preferred design.

    The current CLI customization documentation describes /theme as syntax highlighting, which does not address this use case.

    Related: #8782 tracks distinguishing user input from assistant output, and #51640 concerns the composer background. I am adding the concrete customization requirements here rather than opening another overlapping issue.

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

    TUIenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions