ANSI escape codes leak color/bold into adjacent characters on Windows Terminal
Describe the bug
On Windows 11 with Windows Terminal, ANSI color/style escape codes appear to "leak" into adjacent characters in Claude Code's markdown output. There are two symptoms:
- Random blue/purple letters — Individual characters in regular (non-formatted) prose text render in blue/purple, even when they are not inside inline code backticks or any other markdown formatting.
- Random bold (bright white) characters — Some characters in normal text render in a brighter white (bold weight) for no apparent reason.
Both symptoms appear scattered across the output with no clear pattern tied to the text content itself.
Setting "syntaxHighlightingDisabled": true in ~/.claude/settings.json does not fix the issue.
To reproduce
- Run Claude Code on Windows 11 in Windows Terminal
- Ask it to produce a response with mixed formatting — inline code, bold headers, bullet lists, and regular prose
- Observe that individual characters in plain text randomly render in blue/purple or bold/bright white
Expected behavior
Only intentionally formatted text (inline code, bold, headers, etc.) should have styling applied. Regular prose text should render in the default terminal foreground color with no color or weight bleed.
Environment
- OS: Windows 11 Pro 10.0.26200
- Terminal: Windows Terminal (default)
- Claude Code model: Claude Opus 4.6
syntaxHighlightingDisabled: true— no effect
Additional context
This looks like ANSI SGR reset sequences (\e[0m) are either not being emitted at the correct byte offsets, or Windows Terminal is miscounting character widths when applying them — causing the reset to land a few characters late (or early), leaving residual color/bold on adjacent glyphs.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗