claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Regression: Chinese characters cause incorrect line wrapping in diff view (2.0.74)

Open xiaozhaodong opened this issue 1 week ago • 2 comments

Bug Description

In the diff view, Chinese (CJK) characters cause incorrect line wrapping, resulting in extra blank lines and truncated comments.

Version Information

  • Affected version: 2.0.74
  • Working version: 2.0.72
  • This is a regression introduced in 2.0.73 or 2.0.74

Steps to Reproduce

  1. Edit a file with Chinese comments
  2. View the diff in Claude Code terminal
  3. Observe incorrect line wrapping for CJK characters

Expected Behavior

Chinese comments should render on the same line (as in 2.0.72)

Actual Behavior

Chinese comments are incorrectly truncated and wrapped to the next line, causing:

  • Extra blank lines in diff view
  • Comments split across multiple lines
  • Misaligned diff display

Root Cause (Suspected)

CJK characters are full-width (2 character widths) but the terminal renderer may be calculating them as 1 character width, causing incorrect line width calculation and forced wrapping.

Screenshots

2.0.74

Image

2.0.72

Image

xiaozhaodong avatar Dec 20 '25 02:12 xiaozhaodong

I'm experiencing the same issue on Windows with Japanese text.

Environment:

  • Claude Code: v2.0.74
  • OS: Windows 11
  • Terminal: Windows Terminal (cmd)

Reproduction: When editing files containing Japanese comments, the diff view displays extra blank lines between each line. The issue occurs regardless of content - even simple one-line changes show incorrect spacing.

Image

Screenshot:

shostako avatar Dec 20 '25 11:12 shostako

Update: Tested on v2.0.75, the issue is NOT fully fixed.

Improvements in v2.0.75:

  • Line numbers are now aligned correctly

Still broken:

  • Extra blank lines between diff hunks
  • Empty lines with just + marker appearing (e.g., lines 13, 15)
  • Unnecessary spacing between deleted and added lines

Screenshot from v2.0.75: The diff view still shows excessive blank lines when displaying CJK characters.

Please continue investigating this regression. 2.0.75 Image 2.0.72

Image

xiaozhaodong avatar Dec 22 '25 00:12 xiaozhaodong

This issue still exists in version 2.0.76.

xiaozhaodong avatar Dec 23 '25 04:12 xiaozhaodong