ANSI true color escape sequences not rendered in tool output

Resolved 💬 3 comments Opened Jan 8, 2026 by ewijaya Closed Feb 21, 2026

Description

ANSI 24-bit true color escape sequences (SGR codes) are stripped or not rendered when outputting from Bash tool results. The escape character is removed, leaving the literal bracket codes visible.

Steps to Reproduce

Run a simple Python script that outputs ANSI colored text:

python3 -c "
esc = chr(27)
r, g, b = 200, 10, 140
print(f'{esc}[48;2;{r};{g};{b}m    {esc}[0m #c80a8c')
"

Expected Behavior

A colored block should appear before the hex code, using the terminal's true color (24-bit) support.

Actual Behavior

The escape character is stripped, showing literal codes:

[48;2;200;10;140m    [0m #c80a8c

Use Case

Wanted to add color swatches next to hex codes in a custom command that generates color palettes. Many terminals support 24-bit color, so this would be a nice visual enhancement.

Environment

  • Claude Code CLI
  • Terminal with true color support (iTerm2, modern terminals)

View original on GitHub ↗

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