Thai text broken in TUI: input editing + output rendering
Resolved 💬 4 comments Opened May 20, 2026 by S3Electronics Closed May 24, 2026
Description
Claude Code TUI mishandles Thai combining characters (above/below vowels and tone marks, U+0E30–U+0E4E). These are zero-width marks that stack on the preceding consonant, but Claude Code counts them as 1 cell. This breaks both the input prompt and the rendered output.
Symptoms
Input box (worst impact — blocks composing Thai messages):
- Cursor block drifts off the actual caret position as you type
- Backspace deletes the wrong character
- Cursor visually overlaps glyphs (see screenshot)
- Selecting/editing Thai text is essentially unusable
Output rendering:
- Tool results and Claude responses containing Thai wrap mid-syllable
- Combining marks render shifted one cell to the right of their base
Reproduction
- Run
claudein any terminal (reproduced in macOS Terminal.app, Darwin 24.6.0) - Type Thai in the input, e.g.
ฉันต้องการให้มันไม่บัคแบบนี้ - Try to move the cursor or backspace — position is wrong
Environment
- Claude Code 2.1.145
- macOS Darwin 24.6.0
Likely the string-width logic isn't treating Unicode Mn (Nonspacing Mark) as zero-width. Same class of bug affects Lao, Khmer, Devanagari, Arabic combining marks.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗