[BUG] UI colors quantized to 256 inside WSL under Windows Terminal (WT_SESSION not treated as truecolor)

Status Open
Reported on v2.1.282
Maintainer reply None cached
Activity 1 comment · opened Sep 25, 2026

Summary

Inside WSL under Windows Terminal, Claude Code renders its UI in 256 colors, even though Windows Terminal supports 24-bit color. Theme colors get rounded to the xterm-256 palette, so everything looks washed out next to the same version running natively on Windows in the same terminal.

Environment

  • Claude Code 2.1.282 (Linux native binary)
  • WSL2, Kali Linux, zsh; Windows 11 (10.0.26200), Windows Terminal
  • Default env inside WSL: TERM=xterm-256color, COLORTERM unset, WT_SESSION set (Windows Terminal forwards it via WSLENV), no tmux

Repro / measurement

Ran claude in a pty for 10 s under each setting and counted the foreground SGR sequences it emitted:

| Environment | 24-bit (38;2;…) | 256-color (38;5;…) |
|---|---|---|
| as-is (COLORTERM unset) | 0 | 5 |
| COLORTERM=truecolor | 10 | 0 |
| FORCE_COLOR=3 | 0 | 10 |

Concrete example: the mascot orange #D77757 (215,119,87) becomes palette index 174 (215,135,135), which looks pink. The screenshot pixel matched index 174 exactly.

Cause (from the 2.1.282 bundle)

  • The base level comes from supports-color. TERM=xterm-256color gives level 2 because nothing sets COLORTERM.
  • The upgrade to level 3 only fires for TERM_PROGRAM=vscode or a fixed TERM set (alacritty, contour, foot, ghostty, rio, wezterm, xterm-ghostty, xterm-kitty).
  • WT_SESSION is already read elsewhere, including on Linux, but not for color. isMicrosoftWindowsTerminal() requires platform === "win32".
  • FORCE_COLOR=3 doesn't reach the UI's color level (consistent with #59585).

Suggestion

Treat WT_SESSION as a truecolor signal on Linux as well, i.e. upgrade to level 3 when WT_SESSION is set and TERM is not a tmux/screen TERM. Windows Terminal has supported 24-bit color since 1.0.

Workaround

In ~/.zshrc / ~/.bashrc inside WSL:

[[ -n "$WT_SESSION" ]] && export COLORTERM=truecolor

Write-up: https://github.com/LZong-tw/claude-code-field-notes/blob/main/docs/terminal-colors.md

Related: #77032 (same class of problem in VS Code terminals), #59737 (foot), #59585 (FORCE_COLOR scope).

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗