Hindi/Devanagari text renders broken in terminal TUI — characters scattered across columns

Resolved 💬 3 comments Opened Apr 27, 2026 by randomittin Closed May 29, 2026

Bug

Hindi (Devanagari script) text renders with broken column alignment in Claude Code's terminal UI. Characters are scattered across columns with random spacing, making the output unreadable.

Screenshot

The output shows Hindi text like:

  • "मैं समझ गया" renders as scattered individual characters with wide gaps
  • Devanagari conjuncts and combining marks get split across columns
  • English text on same lines renders fine

Environment

  • Claude Code CLI (terminal mode)
  • macOS (Darwin 25.4.0)
  • Terminal: likely default or iTerm2
  • Font: standard monospace

Root Cause (likely)

Terminal column-width calculation uses wcwidth() which doesn't handle Devanagari complex scripts correctly:

  • Devanagari uses combining characters (matras, virama) that are zero-width
  • Conjunct characters (half-forms) have variable display width
  • The TUI renderer likely assumes each Unicode codepoint = 1 or 2 columns, but Devanagari grapheme clusters don't follow this model

Reproduction

Any prompt that generates Hindi/Devanagari output in the terminal. For example:

claude -p "Write 5 sentences in Hindi about customer service"

Expected

Hindi text renders as readable continuous text, same as it would in any Unicode-capable terminal.

Actual

Characters are spread across the terminal width with large gaps between them, some characters overlapping or misaligned.

Impact

Makes Claude Code unusable for any Hindi/Indic language work — which is a large user base (500M+ Hindi speakers).

Also affects: likely all Indic scripts (Bengali, Tamil, Telugu, Gujarati, etc.) and potentially Arabic, Thai, Khmer, and other complex scripts.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗