claude-code - 💡(How to fix) Fix Color theme renders in 256-color mode inside tmux despite COLORTERM=truecolor

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Claude Code degrades to 256-color mode when the TMUX environment variable is set, even when COLORTERM=truecolor is explicitly configured and the full terminal pipeline supports 24-bit color. This causes custom theme hex colors to be quantized to the nearest 256-color cube entry.

Root Cause

Claude Code appears to check $TMUX and unconditionally degrade color depth when inside a tmux session. This predates the now-standard COLORTERM convention and causes false negatives on modern tmux setups with proper truecolor passthrough configured. The fix would be to honor COLORTERM=truecolor/COLORTERM=24bit (and/or FORCE_COLOR=3) as an override even when $TMUX is set.

Fix Action

Workaround

alias claude='TMUX= claude'

Code Example

alias claude='TMUX= claude'
RAW_BUFFERClick to expand / collapse

Summary

Claude Code degrades to 256-color mode when the TMUX environment variable is set, even when COLORTERM=truecolor is explicitly configured and the full terminal pipeline supports 24-bit color. This causes custom theme hex colors to be quantized to the nearest 256-color cube entry.

Steps to Reproduce

  1. Run Ghostty (or any truecolor terminal) with tmux
  2. Ensure COLORTERM=truecolor is set in the shell
  3. Configure a custom Claude Code theme with a muted/dark hex color, e.g. "userMessageBackground": "#3b4252"
  4. Launch Claude Code inside a tmux pane — colors render incorrectly (e.g. #3b4252#5f5f8a)
  5. Launch Claude Code with TMUX= claude (TMUX unset) in the same pane — colors render correctly

Expected Behavior

Claude Code should respect COLORTERM=truecolor (the standardized signal per https://github.com/termstandard/colors) regardless of whether $TMUX is set.

Actual Behavior

When $TMUX is set, Claude Code falls back to 256-color rendering, ignoring COLORTERM=truecolor. Saturated colors that happen to land exactly on 256-color cube nodes (e.g. #ff0000) appear correct, while off-cube colors are visibly quantized.

Environment

  • Claude Code: 2.1.145
  • Terminal: Ghostty (TERM=xterm-ghostty outside tmux, TERM=tmux-256color inside)
  • tmux: 3.6a (Oh My Tmux configuration)
  • OS: macOS (Darwin 25.4.0, ARM64)
  • COLORTERM=truecolor
  • tmux-256color terminfo has RGB and Tc capabilities ✓
  • terminal-features includes xterm-ghostty:RGB
  • Raw printf '\e[48;2;59;66;82m...\e[0m' truecolor sequences render correctly inside tmux ✓

Workaround

alias claude='TMUX= claude'

Root Cause

Claude Code appears to check $TMUX and unconditionally degrade color depth when inside a tmux session. This predates the now-standard COLORTERM convention and causes false negatives on modern tmux setups with proper truecolor passthrough configured. The fix would be to honor COLORTERM=truecolor/COLORTERM=24bit (and/or FORCE_COLOR=3) as an override even when $TMUX is set.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING