[FEATURE] Preserve ANSI color in assistant-authored text (or expand tool output by default) for text-based terminal plotting

Status Open
Maintainer reply None cached
Activity 2 comments · opened Sep 9, 2026

Preflight Checklist

  • [x] Searched existing requests. Related but distinct:
  • #76846 — full analytical chart rendering via Vega-Lite + Sixel/Kitty passthrough (heavyweight, needs a whole render layer)
  • #64643 / #79706 / #80479 — inline pixel/image rendering via OSC 1337/Sixel/Kitty graphics protocol
  • This request only concerns plain ANSI SGR text color (no pixels, no graphics protocol) for text-mode terminal charting libraries (e.g. Python's plotext, youplot, gnuplot -e "set terminal dumb") that already render charts as colored Unicode/ASCII text in any real terminal — the same coloring mechanism Claude Code's own diffs/syntax highlighting use elsewhere in its UI.
  • [x] Single feature request (two independent options proposed, either would resolve it)

Problem Statement

Terminal-native charting libraries render charts as plain Unicode/braille text with standard ANSI SGR color codes — no image protocol needed. Two things currently block this as a usable inline data-viz path:

  1. When such colored output is copied into Claude's own assistant-authored reply text (as opposed to a tool_result block), the ANSI escape codes are not interpreted — they render as literal garbled text (e.g. [38;5;12m) instead of color. Confirmed by direct testing in a live session.
  2. Bash tool_result output does appear to support ANSI color in some contexts, but tool_result blocks collapse behind a manual click/expand in the fullscreen TUI — so a chart is either fully visible (plain reply text, no color) or colored (tool output, hidden behind a click), never both at once.

Proposed Solution

Either of these independently would resolve it:

  • Render standard ANSI SGR color codes when present in assistant-authored markdown text.
  • OR: a way (tool-call flag / settings.json option) to mark a Bash tool result as "always expanded," bypassing the default fullscreen collapse.

This is much smaller than full graphics-protocol/image rendering (#76846, #64643, #79706, #80479) — no Sixel, no Kitty protocol, no pixels, no render layer — just extending the CLI's existing color-handling to externally-generated colored terminal text.

Use Cases

  • Any CLI tool that renders as colored terminal text rather than raster images: plotext/youplot/gnuplot charts, colored progress output, colored diffs from external tools.
  • Enables genuinely inline (no-click, in-color) charts for terminal-only workflows without the heavier Sixel/Vega-Lite pipeline #76846 proposes.

View original on GitHub ↗

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