claude-code - 💡(How to fix) Fix Thai text broken in TUI: input editing + output rendering

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

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.

Root Cause

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.

RAW_BUFFERClick to expand / collapse

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

  1. Run claude in any terminal (reproduced in macOS Terminal.app, Darwin 24.6.0)
  2. Type Thai in the input, e.g. ฉันต้องการให้มันไม่บัคแบบนี้
  3. 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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING