[BUG] Spinner text garbled when displaying CJK/Chinese characters
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?
The spinner/status line text shows garbled characters intermittently when the text contains Chinese (CJK multi-byte) characters. For example, the spinner displays News‡a‡ering... instead of the expected Chinese text. The issue is intermittent - sometimes renders correctly, sometimes garbled.
The root cause appears to be the spinner overwrite logic using byte length instead of display width (wcwidth/wcswidth) when calculating how many characters to erase via carriage return. CJK characters are double-width on display but 3 bytes in UTF-8, causing stale bytes to remain visible.
What Should Happen?
Spinner text should render CJK characters correctly without garbling, by measuring display width rather than byte length when overwriting the spinner line.
Error Messages/Logs
Steps to Reproduce
- Use TaskCreate with Chinese activeForm text, e.g. activeForm: "建立元件"
- Observe the spinner text while the task is in_progress
- The Chinese characters intermittently render as garbled text
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.89 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗