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

Resolved 💬 17 comments Opened Dec 20, 2025 by xiaozhaodong Closed Feb 6, 2026

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

<img width="1974" height="714" alt="Image" src="https://github.com/user-attachments/assets/097ddd1f-c3c7-44d6-b176-a90d719ad265" />

2.0.72

<img width="1518" height="554" alt="Image" src="https://github.com/user-attachments/assets/196f7ae7-157a-4c9f-af00-42fedb9f53f2" />

View original on GitHub ↗

17 Comments

shostako · 6 months ago

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.

<img width="888" height="349" alt="Image" src="https://github.com/user-attachments/assets/f793f837-9221-43f8-9b87-12f03d83968d" />

Screenshot:

xiaozhaodong · 6 months ago

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
<img width="2074" height="1834" alt="Image" src="https://github.com/user-attachments/assets/7c7c8beb-9168-4936-93cc-565e941e2c1f" />
2.0.72

<img width="1170" height="840" alt="Image" src="https://github.com/user-attachments/assets/2ca04a20-d03f-4c9a-b771-5198c78eb11e" />

xiaozhaodong · 6 months ago

This issue still exists in version 2.0.76.

xiaozhaodong · 6 months ago

Update: Tested on v2.1.1 - NOT fully fixed

Test Results

ASCII diff renders correctly:

  • Lines are compact with no extra spacing
  • Delete/add lines display properly side by side

CJK diff still has issues:

  • Extra blank lines appear after each CJK line
  • Visual height is approximately 2x compared to ASCII equivalent
  • The spacing issue persists across Chinese, Japanese, and Korean characters

Root Cause Analysis

The issue appears to be CJK character width calculation:

  • Full-width CJK characters occupy 2 terminal columns
  • The renderer may be calculating them as 1 column
  • This causes visual overflow and creates phantom blank lines

Comparison

| Feature | ASCII | CJK |
|---------|-------|-----|
| Line spacing | ✅ Compact | ❌ Extra blank lines |
| Delete/Add alignment | ✅ Correct | ❌ Separated by whitespace |
| Overall height | ✅ Normal | ❌ ~2x inflated |

Environment

  • Claude Code: v2.1.1
  • OS: macOS (Darwin 24.6.0)
  • Terminal: Default

The changelog mentioned "Fixed multi-line CJK character formatting" but this specific diff view rendering issue remains unresolved.

<img width="2224" height="1292" alt="Image" src="https://github.com/user-attachments/assets/36a7328f-845b-4230-98d6-804d649ada19" />

<img width="2086" height="1030" alt="Image" src="https://github.com/user-attachments/assets/bc75b928-37fd-4af4-b6a4-898d2d53a710" />

xiaozhaodong · 6 months ago

Update: v2.1.2 - Issue still exists ❌

Tested on v2.1.2 (2026-01-09), the CJK character diff rendering issue still persists.

shostako · 6 months ago

To be fair, this is only a visual issue in the terminal - it doesn't affect the actual code files. I understand that.

However, 5 versions and still unfixed seems a bit much. Surely Anthropic in the Bay Area has native CJK-speaking engineers who encounter these characters daily? I'm genuinely puzzled why a regression like this slips through and stays broken for so long.

CJK issues are like clockwork - they keep resurfacing periodically, just when you thought they were finally behind us.

xiaozhaodong · 6 months ago

Update: v2.1.3 - Issue still exists ❌

Tested on v2.1.3 (2026-01-10), the CJK character diff rendering issue still persists.

Test Environment

  • Version: Claude Code v2.1.3
  • OS: macOS (Darwin 24.6.0)
  • Date: 2026-01-10

Issue Status

The extra blank lines between CJK character lines in diff view remain unfixed. This has been an ongoing issue across multiple versions:

  • v2.0.75 ❌
  • v2.1.1 ❌
  • v2.1.2 ❌
  • v2.1.3 ❌ (current)

Impact

While this is a visual issue that doesn't affect the actual code files, it significantly impacts the developer experience when reviewing CJK code changes. The workaround of using Task subagent instead of direct Edit tool is not ideal.

Request

I will continue to test and report on every new version until this regression is fully resolved. Please prioritize fixing this CJK character width calculation issue in the diff renderer.

xiaozhaodong · 6 months ago

Version 2.1.5 Testing Result

Tested on v2.1.5 (2026-01-12), the CJK character display issue still persists.

Test Environment

  • Version: Claude Code 2.1.5
  • Platform: macOS (Darwin 24.6.0)
  • Language: Chinese Simplified
  • Terminal: Default macOS Terminal

Test Method

Created a Java test file with Chinese comments and used the Edit tool to modify it twice. The diff view still shows the same symptoms reported in earlier versions.

Observed Issues

  • ❌ Extra blank lines between Chinese comment lines
  • ❌ Visual height inflation in diff display
  • ❌ Incorrect line wrapping for CJK characters

Version Timeline Update

| Version | Status |
|---------|--------|
| v2.0.72 | ✅ Working |
| v2.0.73-74 | ❌ Regression introduced |
| v2.0.75 - v2.1.3 | ❌ Still broken |
| v2.1.5 | ❌ Still broken |

The issue has now persisted for 8+ versions since the regression was introduced. This continues to significantly impact CJK language users' experience.

Current Workaround

Still using subagent for file operations in the main session to avoid showing broken diffs to users, as documented in my project's CLAUDE.md configuration.

Hope this can be prioritized for the next release. 🙏

xiaozhaodong · 6 months ago

Update: v2.1.6 - Issue still exists ❌

Tested on v2.1.6 (2026-01-13), the CJK character diff rendering issue still persists.

Test Environment

  • Version: Claude Code v2.1.6
  • OS: macOS (Darwin 25.2.0)
  • Date: 2026-01-13
  • Terminal: Warp

Test Method

Modified a Java test file with Chinese comments using the Edit tool three times. The diff view consistently shows the same symptoms reported in earlier versions.

Observed Issues

  • ❌ Large blank spaces between CJK comment lines
  • ❌ Visual height inflation in diff display
  • ❌ Incorrect spacing between delete/add lines

Version Timeline Update

| Version | Status |
|---------|--------|
| v2.0.72 | ✅ Working |
| v2.0.73-74 | ❌ Regression introduced |
| v2.0.75 - v2.1.5 | ❌ Still broken |
| v2.1.6 | ❌ Still broken |

The issue has now persisted for 9+ versions since the regression was introduced.

Note on Recent Changelog

The v2.1.6 changelog mentions "Fixed text styling (bold, colors) getting progressively misaligned in multi-line responses" which seemed related to CJK character width calculation. However, this fix does not address the diff view rendering issue - it likely only fixes the chat response display alignment.

The workaround of using subagent for file operations continues to be necessary to avoid showing broken diffs to users.

xiaozhaodong · 6 months ago

Update: v2.1.7 - Issue still exists ❌

Tested on v2.1.7 (2026-01-14), the CJK character diff rendering issue still persists.

Test Environment

  • Version: Claude Code v2.1.7
  • OS: macOS (Darwin 25.2.0)
  • Date: 2026-01-14
  • Terminal: Default macOS Terminal

Test Method

Modified a Java test file with Chinese comments using the Edit tool four times consecutively. The diff view consistently shows the same symptoms reported in earlier versions.

Observed Issues

  • ❌ Extra blank lines between CJK comment lines
  • ❌ Visual height inflation in diff display
  • ❌ Incorrect spacing between delete/add lines

Version Timeline Update

| Version | Status |
|---------|--------|
| v2.0.72 | ✅ Working |
| v2.0.73-74 | ❌ Regression introduced |
| v2.0.75 - v2.1.6 | ❌ Still broken |
| v2.1.7 | ❌ Still broken |

The issue has now persisted for 10+ versions since the regression was introduced.

Impact

This continues to significantly impact the developer experience for CJK language users when reviewing code changes. The workaround of using Task subagent instead of direct Edit tool remains necessary to avoid showing broken diffs.

Will continue testing and reporting on future versions until this regression is fully resolved.

xiaozhaodong · 6 months ago

Update: v2.1.9 - Issue still exists ❌

Tested on v2.1.9 (2026-01-16), the CJK character diff rendering issue still persists.

Test Environment

  • Version: Claude Code v2.1.9
  • OS: macOS (Darwin 25.2.0)
  • Date: 2026-01-16
  • Terminal: Warp / iTerm2

Test Method

Modified a Java test file with Chinese comments using the Edit tool. The diff view still shows the same symptoms reported in earlier versions.

Observed Issues

  • ❌ Extra blank lines between CJK comment lines
  • ❌ Visual height inflation in diff display
  • ❌ Incorrect spacing between delete/add lines

Version Timeline Update

| Version | Status |
|---------|--------|
| v2.0.72 | ✅ Working |
| v2.0.73-74 | ❌ Regression introduced |
| v2.0.75 - v2.1.7 | ❌ Still broken |
| v2.1.9 | ❌ Still broken |

The issue has now persisted for 11+ versions since the regression was introduced.

Impact

This continues to significantly impact the developer experience for CJK language users when reviewing code changes. The workaround of using Task subagent instead of direct Edit tool remains necessary to avoid showing broken diffs.

Will continue testing and reporting on future versions until this regression is fully resolved.

xiaozhaodong · 6 months ago

Update: v2.1.11 - Issue still exists ❌

Tested on v2.1.11 (2026-01-17), the CJK character diff rendering issue still persists.

Test Environment

  • Version: Claude Code v2.1.11
  • OS: macOS (Darwin 25.2.0)
  • Date: 2026-01-17
  • Terminal: Warp / iTerm2

Test Method

Modified a Java test file with Chinese comments using the Edit tool twice. The diff view still shows the same symptoms reported in earlier versions.

Observed Issues

  • ❌ Extra blank lines between CJK comment lines
  • ❌ Visual height inflation in diff display
  • ❌ Incorrect spacing between delete/add lines

Version Timeline Update

| Version | Status |
|---------|--------|
| v2.0.72 | ✅ Working |
| v2.0.73-74 | ❌ Regression introduced |
| v2.0.75 - v2.1.9 | ❌ Still broken |
| v2.1.11 | ❌ Still broken |

The issue has now persisted for 12+ versions since the regression was introduced.

Impact

This continues to significantly impact the developer experience for CJK language users when reviewing code changes. The workaround of using Task subagent instead of direct Edit tool remains necessary to avoid showing broken diffs.

Will continue testing and reporting on future versions until this regression is fully resolved. 😔

xiaozhaodong · 5 months ago

Update: v2.1.12 - Issue still exists ❌

Tested on v2.1.12 (2026-01-18), the CJK character diff rendering issue still persists.

Test Environment

  • Version: Claude Code v2.1.12
  • OS: macOS (Darwin 25.2.0)
  • Date: 2026-01-18
  • Terminal: Warp / iTerm2

Test Method

Modified a Java test file with Chinese comments using the Edit tool twice. The diff view still shows the same symptoms reported in earlier versions.

Observed Issues

  • ❌ Extra blank lines between CJK comment lines
  • ❌ Visual height inflation in diff display
  • ❌ Incorrect spacing between delete/add lines

Version Timeline Update

| Version | Status |
|---------|--------|
| v2.0.72 | ✅ Working |
| v2.0.73-74 | ❌ Regression introduced |
| v2.0.75 - v2.1.11 | ❌ Still broken |
| v2.1.12 | ❌ Still broken |

The issue has now persisted for 13+ versions since the regression was introduced.

Impact

This continues to significantly impact the developer experience for CJK language users when reviewing code changes. The workaround of using Task subagent instead of direct Edit tool remains necessary to avoid showing broken diffs.

Will continue testing and reporting on future versions until this regression is fully resolved. 😔

xiaozhaodong · 5 months ago

Update: v2.1.14 - Issue still exists ❌

Tested on v2.1.14 (2026-01-21), the CJK character diff rendering issue still persists.

Test Environment

  • Version: Claude Code v2.1.14
  • OS: macOS (Darwin 25.2.0)
  • Date: 2026-01-21
  • Terminal: Warp

Test Method

Modified a Java test file with Chinese comments using the Edit tool twice. The diff view still shows the same symptoms reported in earlier versions.

Observed Issues

  • ❌ Extra blank lines between CJK comment lines
  • ❌ Visual height inflation in diff display
  • ❌ Incorrect spacing between delete/add lines

Version Timeline Update

| Version | Status |
|---------|--------|
| v2.0.72 | ✅ Working |
| v2.0.73-74 | ❌ Regression introduced |
| v2.0.75 - v2.1.12 | ❌ Still broken |
| v2.1.14 | ❌ Still broken |

The issue has now persisted for 14+ versions since the regression was introduced.

Impact

This continues to significantly impact the developer experience for CJK language users when reviewing code changes. The workaround of using Task subagent instead of direct Edit tool remains necessary to avoid showing broken diffs.

Will continue testing and reporting on future versions until this regression is fully resolved. 😔

xiaozhaodong · 5 months ago

Update: v2.1.17 - Issue FIXED ✅

Tested on v2.1.17 (2026-01-23), the CJK character diff rendering issue has been FULLY FIXED\! 🎉

Test Environment

  • Version: Claude Code v2.1.17
  • OS: macOS (Darwin 25.2.0)
  • Date: 2026-01-23 09:05
  • Terminal: Warp

Test Method

Modified a Java test file with Chinese comments three times using the Edit tool. The diff view now displays correctly with no extra blank lines or height inflation.

Test Results

Chinese lines display compactly - No extra blank lines between CJK comment lines
Line height is normal - Visual height matches English text (no 2x inflation)
Delete/Add alignment is correct - No excessive spacing between removed and added lines
CJK character width calculation is fixed - Proper full-width character handling

Observed Improvements

  • Line numbers are properly aligned
  • Diff hunks display without unnecessary spacing
  • Multiple consecutive Chinese comment lines render correctly
  • Both JavaDoc comments and inline comments work as expected

Version Timeline (Final Update)

| Version | Status |
|---------|--------|
| v2.0.72 | ✅ Working |
| v2.0.73-74 | ❌ Regression introduced |
| v2.0.75 - v2.1.16 | ❌ Broken (15+ versions) |
| v2.1.17 | ✅ FIXED\! 🎉 |

Impact

This fix resolves a critical regression that has affected CJK (Chinese, Japanese, Korean) users for over 15 versions. The diff view is now usable again for code files containing CJK characters, eliminating the need for workarounds like using Task subagents.

Acknowledgment

After months of testing every release and reporting status updates, I'm thrilled to confirm this issue is finally resolved\! Thank you to the development team for fixing this CJK rendering bug. This will greatly improve the experience for all Chinese, Japanese, and Korean developers using Claude Code.

问题终于修复了!感谢开发团队的努力!🙏

alii · 5 months ago

Thank you - closing as per the comment above. :tada:

github-actions[bot] · 5 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.