Bidirectional text rendering: mixed Arabic/English on the same line breaks visual order
Description
When Claude Code's VSCode extension renders a line containing both Arabic (RTL) and English (LTR) text, the visual order of words is incorrect. The Unicode Bidirectional Algorithm picks up the first strong directional character and applies it as the base direction for the whole paragraph, which causes embedded LTR runs (and vice versa) to appear in unexpected positions.
Why This Matters
The Arabic-speaking developer community is not small and should not be treated as an afterthought. Arabic is spoken by 400+ million people, and a rapidly growing share of them are software developers shipping production code — many of whom write in a mix of Arabic and English every single day (variable names, identifiers, and English keywords are unavoidable in any technical conversation).
A broken bidi renderer makes Claude Code actively painful to use for this audience. This is not a cosmetic polish issue — it directly affects readability of every assistant response that mixes scripts, which is most of them for Arabic-speaking users. We expect (and deserve) the same baseline rendering quality that LTR users get by default.
Please prioritize this accordingly.
Reproduction
Ask Claude any question and have it produce a response containing mixed Arabic + English on a single line, e.g.:
مرحبا hello يا صديقي world
Expected
Each directional run displays in its logical/intended position, regardless of the surrounding paragraph direction.
Actual
Words appear reordered visually. The English word world ends up on the wrong side of the Arabic text. (Screenshot can be attached.)
Suggested Fix
Wrap directional runs in the markdown renderer with Unicode bidi isolates:
U+2068FIRST STRONG ISOLATE (FSI) …U+2069POP DIRECTIONAL ISOLATE (PDI)- Or use
<bdi>elements if the renderer outputs HTML
This is the standard fix for chat-style UIs that mix scripts (used by Slack, Discord, GitHub markdown rendering, etc.).
Environment
- Claude Code: VSCode extension
- OS: macOS (Darwin 25.0.0)
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗