[BUG] Broken syntax highlighting with non-ASCII characters (diacritics) in terminal output
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?
Any colored terminal output containing non-ASCII characters (Czech diacritics: č, ř, ž, š, ě, ů, etc.) displays with broken syntax highlighting. Individual characters within words receive random colors (red, green, blue, yellow), making the text very hard to read.
This is not limited to plan mode — it happens in any colored output (code diffs, markdown rendering, XAML code blocks, etc.) whenever the text contains multi-byte UTF-8 characters.
The coloring appears to be applied per-character rather than following any syntax highlighting rules. This likely points to the same underlying issue as #23851 (multi-byte UTF-8 character offset problem in the highlight.js → ANSI conversion layer).
Possibly related to #20799 and #23851.
What Should Happen?
Readable formatting with consistent colors based on syntax rules, regardless of whether the text contains ASCII-only or multi-byte UTF-8 characters (diacritics, Cyrillic, CJK, etc.).
Error Messages/Logs
No error messages - this is a visual rendering issue only.
Steps to Reproduce
- Run
claudein Windows Terminal (PowerShell) - Trigger any colored output containing non-ASCII characters — e.g. write a plan with Czech text and XAML code blocks, or ask Claude to display code with comments containing diacritics
- Observe the terminal output
- Individual characters within words have random colors (red, green, blue, yellow) instead of consistent syntax highlighting
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.38 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
Screenshot showing the broken highlighting (XAML code blocks with Czech text):
<img width="1066" height="572" alt="Broken syntax highlighting with Czech diacritics" src="https://github.com/user-attachments/assets/4f13aa49-b319-4690-be98-476582fd22b2" />
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗