[BUG] Spinner text garbled when displaying CJK/Chinese characters

Resolved 💬 3 comments Opened Apr 1, 2026 by sc-tk Closed May 15, 2026

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

  1. Use TaskCreate with Chinese activeForm text, e.g. activeForm: "建立元件"
  2. Observe the spinner text while the task is in_progress
  3. 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_

View original on GitHub ↗

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