claude-code - 💡(How to fix) Fix TUI: input box does not right-align for RTL languages (Hebrew/Arabic/Persian/Urdu)

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…

When typing Hebrew (or any RTL script) into the input prompt, the Claude Code TUI does not align the input box for RTL. Within each wrapped line the characters reorder correctly thanks to the host terminal's BiDi rendering, but the input box itself is left-anchored: the partial last line of typed Hebrew sits flush with the LEFT edge of the box, while a Hebrew reader expects it to continue from the RIGHT edge.

Root Cause

When typing Hebrew (or any RTL script) into the input prompt, the Claude Code TUI does not align the input box for RTL. Within each wrapped line the characters reorder correctly thanks to the host terminal's BiDi rendering, but the input box itself is left-anchored: the partial last line of typed Hebrew sits flush with the LEFT edge of the box, while a Hebrew reader expects it to continue from the RIGHT edge.

RAW_BUFFERClick to expand / collapse

Description

When typing Hebrew (or any RTL script) into the input prompt, the Claude Code TUI does not align the input box for RTL. Within each wrapped line the characters reorder correctly thanks to the host terminal's BiDi rendering, but the input box itself is left-anchored: the partial last line of typed Hebrew sits flush with the LEFT edge of the box, while a Hebrew reader expects it to continue from the RIGHT edge.

Steps to reproduce

  1. Open Claude Code in a BiDi-capable terminal (WezTerm with bidi_enabled = true)
  2. Type any Hebrew sentence long enough to wrap two or more lines into the input prompt, e.g.: זהו משפט לדוגמה בעברית לבדיקת יישור טקסט בתיבת קלט הכולל מספיק תווים כדי להיגלל לפחות לשתי שורות נפרדות
  3. Observe the layout of the wrapped lines and cursor position

Expected

For RTL text the input box should flip its alignment:

  • First line begins at the right edge
  • Wraps continue at the right edge of subsequent lines
  • The trailing partial line sits at the right edge with the cursor on its left side
  • Cursor advances to the left as new characters are typed

Actual

  • Whole-line characters are correctly reordered visually (terminal BiDi works)
  • BUT the input box treats every line as left-anchored: the partial last line ends in the middle/left of the box rather than starting from the right
  • Cursor sits at the left side of the line, advancing leftward, but visually disconnected from where the next typed character will appear from a Hebrew reader's perspective

Visual reference

(Screenshot of Hebrew in the input box - I can attach if useful)

Environment

  • Claude Code: latest
  • Terminal: WezTerm with bidi_enabled = true, bidi_direction = 'AutoLeftToRight'
  • OS: Windows 11 (WSL2 Ubuntu)
  • Locale: Hebrew

Suggested fix

Detect predominant text direction of the current input buffer (per Unicode UAX #9 BiDi resolution) and right-align the input box when RTL. The host terminal handles intra-line glyph reordering; the TUI should handle box-level alignment and cursor anchor side.

Impact

This affects every Hebrew, Arabic, Persian, and Urdu user. RTL is a first-class concern for any TUI that accepts free-text input from those locales.


Filed by Claude Opus 4.7 acting as a coding agent on behalf of @royachiron, who observed and reproduced the bug while we were working together.

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

claude-code - 💡(How to fix) Fix TUI: input box does not right-align for RTL languages (Hebrew/Arabic/Persian/Urdu)