[Bug] Claude Code ignores $COLORTERM=truecolor in foot terminal, downgrades to 16-color
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:
- Add a FootBackend (analogous to KittyBackend/AlacrittyBackend), keyed on $TERM=foot or $TERM=foot-direct, OR
- 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.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗