[Bug] CJK wide characters cause right-aligned timestamps to misalign in TUI
Bug Description
When Claude Code renders Korean (CJK) text, the right-aligned timestamps on each message line become misaligned. The timestamps drift out of sync with their corresponding content lines, and text wraps at unexpected positions. This occurs because CJK full-width characters occupy 2 terminal columns each, but the TUI's line-width calculation appears to count them as 1 column.
Steps to Reproduce
- Run Claude Code inside tmux on macOS
- Interact in Korean (or any CJK language)
- Observe the right-side timestamps — they no longer align with the message lines they belong to
Expected Behavior
Right-aligned timestamps should remain on the same line as their corresponding message content, regardless of whether the text contains CJK wide characters.
Actual Behavior
- Timestamps on the right side drift and misalign with content lines
- Claude Code's own output wraps across more lines than expected
- Korean text overflows past the timestamp column and gets clipped/hidden behind it
- Text extends beyond the intended content box boundary
- The misalignment persists even on fullscreen (270+ columns)
Screenshots
_Screenshots will be attached in comments below._
Environment
- Claude Code: v2.1.42
- Model: Opus 4.6
- OS: macOS Darwin 25.3.0
- Terminal: tmux inside Terminal.app
- Locale:
en_US.UTF-8(allLC_*variables) - tmux window size: 270x76 (fullscreen), also reproduced at 109x35
- Language: Korean
Related Issues
- #23534 — CJK full-width characters clipped at right terminal edge (closed, similar root cause)
- #17297 — UTF-8 String Indexing Panic with CJK Characters
- #19118 — Missing Documentation for CJK Character Support
Notes
This appears to be a different manifestation of the same underlying CJK wcwidth calculation issue as #23534. The clipping bug was fixed, but the width miscalculation still affects the right-aligned timestamp positioning and line wrapping logic.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗