FORCE_COLOR=3 does not override 256-color rendering inside tmux

Resolved 💬 3 comments Opened Mar 23, 2026 by jacobcxdev Closed Apr 22, 2026

Bug

Claude Code renders 256-color escape sequences inside tmux even when FORCE_COLOR=3 is set. The workaround is unsetting TMUX entirely (TMUX= claude).

Root cause chain

  1. Bun's getColorDepth() checks $TMUX before $COLORTERM, returning 8 (256-color) even when COLORTERM=truecolor — filed as oven-sh/bun#28463
  2. FORCE_COLOR=3 correctly makes tty.WriteStream.getColorDepth() return 24 at the JS level (verified with MRE)
  3. However, Claude Code's rendering still uses 256-color output — suggesting a separate colour detection path that doesn't respect FORCE_COLOR or getColorDepth()

Reproduction

Inside tmux with COLORTERM=truecolor:

# Does NOT fix colors — still 256-color output
FORCE_COLOR=3 claude

# DOES fix colors — true color output
TMUX= claude

Verify with Digital Color Meter on the status bar — e.g. "bypass permissions on" text uses noticeably different (shifted) colors in 256-color mode vs true color.

Expected behaviour

FORCE_COLOR=3 should force 24-bit true color rendering, consistent with the Node.js/Bun convention.

Environment

  • Claude Code: 2.1.81
  • Bun: bundled (compiled Mach-O binary)
  • tmux: 3.6a
  • iTerm2: 3.6.9
  • macOS: Darwin 25.3.0 (arm64)

Workaround

Launch Claude Code with TMUX= unset:

TMUX= claude

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗