Backspace in prompt input deletes entire Thai grapheme cluster instead of one code point
Summary
When typing Thai (and likely other scripts that use combining characters — Arabic, Devanagari, Hebrew, etc.) into the interactive prompt input, pressing Backspace once deletes the entire grapheme cluster (the whole visible syllable) instead of removing only the last code point. This makes it very hard to correct typing mistakes on a single tone mark or vowel sign.
Reproduction
- Start an interactive session:
claude - In the prompt input box, type the Thai word
ทำ(which isทU+0E17 +ำU+0E33 — 2 code points, 1 grapheme cluster) - Press Backspace once
Expected: only ำ (U+0E33) is removed; ท remains in the input.
Actual: both code points are removed at once — the entire word disappears.
Same behavior with นี่ (น U+0E19 + ี U+0E35 + ่ U+0E48): one Backspace removes all three code points instead of just the tone mark ่.
Why this matters
Thai writers routinely need to fix a single misplaced vowel or tone mark mid-word. Today the only way to do that is to retype the entire syllable, which is a significant friction for any non-trivial Thai prompt. The same issue likely affects Arabic harakat, Devanagari matras, Hebrew niqqud, and other combining-mark scripts.
Environment
- Claude Code: 2.1.144
- macOS: 15.5 (arm64)
- Terminal: Ghostty (also reproducible regardless of terminal, since the behavior is in CC's input layer, not the terminal)
TERM=xterm-256color,LANG=en_US.UTF-8
Notes
- The bug is in Claude Code's prompt input implementation (Ink-based), not in the terminal — Ghostty handles grapheme clusters correctly elsewhere, and this reproduces in iTerm2 / Terminal.app as well.
- I checked
claude --helpthoroughly and found no flag/env var to switch the deletion granularity (code point vs grapheme cluster). - Suggested fix: on Backspace, remove only the last Unicode code point (or, even better, the last extended-grapheme-cluster component) rather than the whole grapheme cluster. Standard
readline/most native text inputs delete one code point at a time, which is the muscle-memory expectation.
Workarounds users currently rely on
- Use an external editor (
$EDITOR) for any non-trivial Thai input — but this defeats the inline-chat UX. - Compose text in another app and paste it in.
Neither is acceptable for everyday typing.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗