Custom statusline 24-bit truecolor gradient quantized to flat color bands inside claudecode.nvim pty
Bug: Custom statusline 24-bit truecolor gradient quantized to flat color bands inside claudecode.nvim pty
Claude Code version: 2.1.234
Environment:
- OS: Linux (WSL2, 6.6.87.2-microsoft-standard-WSL2)
- Editor integration: Neovim (LazyVim distribution) with the
lazyvim.plugins.extras.ai.claudecodeextra (wrapsclaudecode.nvim) - Statusline: custom
command-type statusline script emitting raw 24-bit ANSI (\033[38;2;r;g;bm) escape codes for a green→yellow→red gradient progress bar (rate-limit usage bar)
Steps to reproduce:
- Configure a custom statusline script in
settings.json(statusLine.type = "command") that prints a 24-bit truecolor gradient using rawESC[38;2;r;g;bmSGR sequences. - Run
claudenormally in a standalone terminal (or in Neovim's plain:terminal, without theclaudecode.nvimplugin) — the statusline renders the full smooth green→yellow→red gradient correctly. - Run
claudethrough theclaudecode.nvimplugin (LazyVimai.claudecodeextra), which opens Claude Code inside an embedded Neovim terminal buffer/pane. - Observe the same statusline script's output in that pane.
Expected: Smooth 24-bit gradient, identical to the standalone terminal.
Actual: The gradient is quantized down to ~3 flat, uniformly-colored bands (green / yellow-orange / red) with hard edges instead of a continuous transition — as if downsampled to a small ANSI palette.
Ruled out:
termguicolorsis enabled in the Neovim session (nvim --headless -c 'lua print(vim.o.termguicolors)'→true; LazyVim sets this by default).- Environment variables as seen by the Claude Code process itself (checked via its own Bash tool, from inside the affected
claudecode.nvimsession):TERM=xterm-256color,COLORTERM=truecolor— both correct and present.
Since neither Neovim's own color mode nor the environment variables Claude Code would use for terminal-capability detection are at fault, this looks like it may be the same class of issue as:
- #35371 — Statusline truecolor quantization regression in tmux (v2.1.77)
- #35806 — Custom statusline colors washed out in truecolor terminals since 2.1.78
but reproducing in a different kind of wrapped/nested pty (Neovim terminal buffer via a plugin) rather than tmux, and still present as of 2.1.234 — suggesting the statusline color-capability detection may not be correctly identifying truecolor support in any nested/wrapped pty, not just tmux specifically.
Additional context: Raw ANSI truecolor escapes work fine when printed directly to the same underlying pty outside of Claude Code's own statusline rendering path, which points at Claude Code's own capability detection/rendering for the statusline specifically, rather than a terminal or Neovim limitation.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗