claude-code - 💡(How to fix) Fix [Bug] Claude Code ignores $COLORTERM=truecolor in foot terminal, downgrades to 16-color

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…

Fix Action

Fix / Workaround

There is no FootBackend. Backend selection appears to dispatch on terminal-specific identifying env vars (GHOSTTY_RESOURCES_DIR, KITTY_WINDOW_ID, WEZTERM_EXECUTABLE, ITERM_SESSION_ID, …). Foot doesn't leak any such identifier — only the standard $TERM=foot and $COLORTERM=truecolor — so Claude falls through to a fallback path that doesn't honor $COLORTERM and emits 16-color (or 256-color) ANSI palette codes instead of truecolor \e[38;2;R;G;Bm sequences.

There is no FootBackend. Backend selection appears to dispatch on terminal-specific identifying env vars (GHOSTTY_RESOURCES_DIR, KITTY_WINDOW_ID, WEZTERM_EXECUTABLE, ITERM_SESSION_ID, …). Foot doesn't leak any such identifier — only the standard $TERM=foot and $COLORTERM=truecolor — so Claude falls through to a fallback path that doesn't honor $COLORTERM and emits 16-color (or 256-color) ANSI palette codes instead of truecolor \e[38;2;R;G;Bm sequences.

RAW_BUFFERClick to expand / collapse

Environment

  • Claude Code: 2.1.143
  • Terminal: foot 1.16.2 (Wayland-native; full truecolor support)
  • OS: Pop_OS! 24.04 LTS
  • Shell: zsh 5.9
  • $TERM=foot, $COLORTERM=truecolor (foot sets these in every child process automatically — see foot docs)

Symptom

The exact same hex color renders differently depending on whether Claude Code emits it or the shell emits it directly — implicating Claude's color-depth detection rather than the terminal:

In foot, outside Claude — renders correctly as a muted gray-blue:

printf '\e[38;2;150;157;184m#969db8\e[0m\n'

In foot, inside Claude — the same #969db8 renders as saturated blue.

That's the signature of a 16-color fallback choosing nearest "bright blue"

(palette 12), not truecolor.

The same Claude session running in ghostty (or kitty, iTerm, etc.) renders #969db8 correctly. Only Claude + foot is broken.

Suspected cause

strings on the Claude Code binary reveals explicit terminal-specific backends:

GhosttyBackend KittyBackend ITermBackend WezTerm Alacritty

There is no FootBackend. Backend selection appears to dispatch on terminal-specific identifying env vars (GHOSTTY_RESOURCES_DIR, KITTY_WINDOW_ID, WEZTERM_EXECUTABLE, ITERM_SESSION_ID, …). Foot doesn't leak any such identifier — only the standard $TERM=foot and $COLORTERM=truecolor — so Claude falls through to a fallback path that doesn't honor $COLORTERM and emits 16-color (or 256-color) ANSI palette codes instead of truecolor \e[38;2;R;G;Bm sequences.

Expected

When $COLORTERM=truecolor, Claude Code should emit truecolor escape sequences regardless of $TERM or the absence of a terminal-specific env var. Foot fully supports the same \e[38;2;R;G;Bm syntax as kitty/alacritty/ghostty.

The exact same hex color renders differently depending on whether Claude Code emits it or the shell emits it directly — implicating Claude's color-depth detection rather than the terminal:

In foot, outside Claude — renders correctly as a muted gray-blue:

The exact same hex color renders differently depending on whether Claude Code emits it or the shell emits it directly — implicating Claude's color-depth detection rather than the terminal:

In foot, outside Claude — renders correctly as a muted gray-blue:

printf '\e[38;2;150;157;184m#969db8\e[0m\n'

In foot, inside Claude — the same #969db8 renders as saturated blue.

That's the signature of a 16-color fallback choosing nearest "bright blue"

(palette 12), not truecolor.

The same Claude session running in ghostty (or kitty, iTerm, etc.) renders #969db8 correctly. Only Claude + foot is broken.

Suspected cause

strings on the Claude Code binary reveals explicit terminal-specific backends:

GhosttyBackend KittyBackend ITermBackend WezTerm Alacritty

There is no FootBackend. Backend selection appears to dispatch on terminal-specific identifying env vars (GHOSTTY_RESOURCES_DIR, KITTY_WINDOW_ID, WEZTERM_EXECUTABLE, ITERM_SESSION_ID, …). Foot doesn't leak any such identifier — only the standard $TERM=foot and $COLORTERM=truecolor — so Claude falls through to a fallback path that doesn't honor $COLORTERM and emits 16-color (or 256-color) ANSI palette codes instead of truecolor \e[38;2;R;G;Bm sequences.

Expected

When $COLORTERM=truecolor, Claude Code should emit truecolor escape sequences regardless of $TERM or the absence of a terminal-specific env var. Foot fully supports the same \e[38;2;R;G;Bm syntax as kitty/alacritty/ghostty.

Suggested fix

Either:

  1. Add a FootBackend (analogous to KittyBackend/AlacrittyBackend), keyed on $TERM=foot or $TERM=foot-direct, OR
  2. Have the fallback backend honor $COLORTERM=truecolor as a sufficient signal for emitting 24-bit color regardless of $TERM.

Option 2 is the more durable fix — it also covers other Wayland terminals that don't leak identifying env vars (e.g., custom wezterm builds, alacritty-on-wayland setups that scrub $ALACRITTY_LOG, niche terminals like wayst, havoc).

Related

  • #36785 — chalk's hardcoded $TMUX-presence truecolor downgrade. Different mechanism but same family: color-depth detection ignoring $COLORTERM.

Repro environment

  • Foot install: sudo apt install foot on Ubuntu 24+ / Debian 13+, or build from https://codeberg.org/dnkl/foot
  • Confirm truecolor works in foot outside Claude: the printf snippet above renders gray-blue, not bright blue. If it doesn't, your foot install isn't passing truecolor through — investigate that first before filing.

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

claude-code - 💡(How to fix) Fix [Bug] Claude Code ignores $COLORTERM=truecolor in foot terminal, downgrades to 16-color