Skip to content

Configurable per-item colors and threshold-based styling for statusline #15400

Open

Description

@0xRaduan

Variant: CLI

Feature description

The statusline currently renders all items in a uniform style. It would be useful to assign distinct colors to individual items, and to have colors shift automatically based on threshold values — e.g., context usage turns amber at 60% and red at 80%.

Proposed config

[tui.status_line_styles]

[tui.status_line_styles.model-with-reasoning]
style = "bold cyan"

[tui.status_line_styles.context-used]
style = "green"
warn_threshold = 60.0
warn_style = "yellow"
critical_threshold = 80.0
critical_style = "bold red"

[tui.status_line_styles.five-hour-limit]
style = "purple"
warn_threshold = 60.0
warn_style = "yellow"
critical_threshold = 80.0
critical_style = "bold red"

[tui.status_line_styles.weekly-limit]
style = "purple"
warn_threshold = 60.0
warn_style = "yellow"
critical_threshold = 80.0
critical_style = "bold red"

[tui.status_line_styles.git-branch]
style = "bold magenta"

Why

  • At a glance, you can distinguish model from context from rate limits — right now everything blends together
  • Threshold-based coloring gives an early visual warning when context or rate limits are filling up, without having to read the numbers
  • The statusline already supports selecting and reordering items via /statusline and [tui].status_line — per-item styling is the natural next step

Implementation notes

  • ratatui Style is already used throughout the TUI, so the rendering plumbing exists
  • Color parsing could support named colors (red, bold yellow) and hex (#f7768e) to match terminal conventions
  • Items without a configured style would continue rendering with the current default — fully backwards compatible
  • The threshold logic would apply to items that have a numeric value (context-used, context-remaining, five-hour-limit, weekly-limit, used-tokens); for non-numeric items, only style would apply

Related issues: #12841 (ANSI color control), #14043 (custom statusline widget API), #15278 (configurable prompt/background)

Activity

  1. added
    enhancement
    TUI
    on Mar 21, 2026
  2. o6uoq commented on Mar 28, 2026

    @o6uoq

    +1

  3. cgongye-n commented on Apr 24, 2026

    @cgongye-n

    Adding another user signal for this. The new /statusline support is useful, but the footer is visually much flatter than Claude Code’s status bar. Per-item colors, especially for model/reasoning, cost or usage, context, token counts, git branch, and cwd/project, would make the status line much easier to scan at a glance. Even a small built-in palette or theme option would help if full per-item style config is too much initially.

  4. Moviw commented on Sep 30, 2026

    @Moviw

    For the threshold-coloring part of this, codex-statusline already does it in a bar under the Codex TUI: context turns yellow at 80% and red at 95%, and 5h/weekly quota turn yellow/red at thresholds you set.

    # ~/.config/codex-statusline/config.toml
    segments = ["ctx", "5h", "week", "tokens"]
    warn_at = 20       # quota remaining % -> yellow
    crit_at = 5        # quota remaining % -> red
    theme = "auto"     # follows light or dark terminals

    You keep typing codex as usual. Install: uv tool install codex-statusline && codex-statusline install

  5. adrijshikhar commented on Oct 1, 2026

    @adrijshikhar

    For anyone looking for custom colors, threshold-based styling, and Powerline themes in Codex CLI, take a look at cxstatusline.

    It provides:

    • Per-Widget Styling: Foreground & background ANSI / TrueColor palettes
    • Visual Themes: Built-in Powerline separators (arrows, curved, angled, flame)
    • Visual Warnings: Threshold-aware context and quota bars
    • Interactive Editor: Visual configurator in your terminal (cxstatusline) or in the web playground

    👉 Web Playground: https://cxstatusline.adrijshikhar.dev
    📦 GitHub Repo: https://github.com/adrijshikhar/cxstatusline

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