[BUG] Markdown italics rendered with Unicode math-alphabet codepoints — garbled on selection / copy / search
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Claude Code renders markdown italic / bold-italic (and possibly other styled spans) by substituting ASCII letters with characters from the Unicode Mathematical Alphanumeric Symbols block (U+1D400–U+1D7FF) instead of emitting ANSI italic escapes (ESC[3m). The styled text looks acceptable inline when the terminal font has glyphs for those codepoints, but the substitution silently breaks several things:
- Selection rendering: when italicized text is highlighted with the mouse, the terminal falls back to a different font for the selection foreground, exposing the math-alphabet glyphs. Entire italicized regions look like Zalgo / IPA-mashup text instead of italics.
- Copy/paste: selecting and copying italicized text yields
𝓲𝓼instead ofis, so pasted content is unreadable in other apps and invisible togrep. - Search / grep:
grep "is"against a saved transcript misses italicized occurrences because the codepoints aren't ASCIIi/s. - Accessibility: screen readers announce these codepoints character-by-character ("mathematical script small i, mathematical script small s") instead of reading the word.
Likely the same root cause as #59660 ("Session-summary text renders garbled (box-drawing/Cyrillic glyphs) in Cursor terminal — 2.1.142/2.1.143"). That issue describes the same symptom in the session-summary block on macOS + Cursor and explicitly hypothesises math-italic Unicode codepoints as the cause. This report extends the repro to Linux + VS Code integrated terminal and shows the corruption also affects markdown emphasis in the agent's response body — not just the summary block.
What Should Happen?
Emit ANSI italic SGR (ESC[3m / ESC[23m) for italics. Most modern terminals (iTerm2, WezTerm, Kitty, Alacritty, GNOME Terminal, VS Code's integrated terminal) support italics natively when paired with an italic-capable font. On terminals that don't, prefer leaving the text as plain ASCII over substituting non-ASCII codepoints — preserving copy/paste fidelity, search, and accessibility is more valuable than rendering the slant.
Error Messages/Logs
Steps to Reproduce
- Launch
claudeinside VS Code's integrated terminal (TERM_PROGRAM=vscode,TERM=xterm-256color). - Run any prompt whose response uses markdown italics, e.g.:
````
claude "Explain Outlook vs Gmail connectors using *italic* for key terms."
- Wait for the response. Italicized words render as styled Latin-looking glyphs.
- With the mouse, click-drag to select a region of the response that includes italicized text. The selection-highlighted glyphs visibly change — italicized words become garbled.
- Copy the selection and paste into another editor (e.g. a new file). Italicized words paste as
𝓲𝓽𝓪𝓵𝓲𝓬𝓼etc. - Run
grep -F "italics" <pasted-file>. No match.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_(unknown — see #59660 which reports 2.1.138 as last clean on the related session-summary surface)_
Claude Code Version
2.1.148 (Claude Code)
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
VS Code integrated terminal
Additional Information
- Claude Code: 2.1.148
- Terminal: VS Code integrated terminal (
TERM_PROGRAM=vscode,TERM_PROGRAM_VERSION=1.115.0) - TERM:
xterm-256color - OS: Linux 5.4.0-200-generic #220-Ubuntu SMP x86_64
Workarounds (current, neither acceptable as default):
- Ask the assistant not to use markdown emphasis.
- Pipe output through a normalizer that maps the U+1D400 range back to ASCII.
Screenshots illustrating the bug — italicized prose rendered "normally" vs. the same prose with mouse selection exposing math-alphabet glyphs — will be attached as a follow-up comment (drag-and-drop, since gh can't upload images inline).
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗