Terminal UI rendering breaks on Bengali (Bangla) / complex-script text — corrupted gutter, misaligned columns, overlapping glyphs
Summary
Claude Code's terminal UI renders incorrectly when file content contains Bengali (Bangla) script (and likely other complex scripts that use combining marks / multi-codepoint grapheme clusters). When Claude streams or displays a diff/file containing Bangla text, the TUI's column accounting breaks: the line-number gutter gets corrupted, columns lose alignment, glyphs overlap and bleed across the screen, and the diff becomes unreadable.
Plain Latin-only output on the same screen renders fine — the corruption is specifically triggered by the complex script.
Steps to reproduce
- Open Claude Code in a terminal.
- Have Claude read/generate/diff a file whose contents include Bengali (Bangla) text — e.g. UI strings, headings, or markdown in Bangla (
title: "প্রিপেইড বনাম পোস্টপেইড...", etc.). - Watch the streamed code/diff view render.
Expected behavior
Bangla (and other complex-script) text should render with correct cell width so the line-number gutter, indentation, and columns stay aligned — the way a properly Unicode-aware terminal UI handles wide and combining characters.
Actual behavior
- The left line-number gutter is overwritten with garbled fragments of Bangla glyphs.
- Column alignment is lost; text wraps/overlaps unpredictably.
- Diff content with Bangla becomes unreadable, with stray characters left along the right edge and overlapping rows.
- The same session renders pure-Latin output (e.g. the plain-English recap screen) correctly, confirming the trigger is the complex script, not the terminal in general.
A screen recording demonstrating the issue is attached in a comment below.
Likely cause
This looks like a grapheme-cluster / character-width accounting bug in the TUI's rendering layer. Bengali uses combining vowel signs and conjuncts where one user-perceived character spans multiple Unicode codepoints (and zero-width combining marks). If the renderer counts codepoints (or assumes 1 cell per codepoint) instead of measuring display width by grapheme cluster, the cursor/column math drifts and corrupts the layout. This class of bug typically also affects other Indic scripts, emoji ZWJ sequences, and some CJK combining cases.
Environment
| | |
|---|---|
| Claude Code version | 2.1.170 |
| OS | macOS 26.5.1 (build 25F80), arm64 (Apple Silicon) |
| Shell | zsh |
| Window size | 120×40 |
Note: the cause is character-width accounting in Claude Code's own rendering, so this is expected to reproduce across terminal emulators.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗