Problem
When typing or displaying Hebrew (and other RTL scripts) in opencode's CLI interface, the text renders with broken BiDi — characters appear in the wrong visual order because most terminal emulators lack proper bidirectional text support.
This affects a significant user base (Hebrew, Arabic, Persian, Urdu, etc.) and is not a trivial cosmetic issue — it makes the tool unusable for prompts and responses in RTL languages.
Example
Typing Hebrew text in the chat produces output where words appear disjointed or in reverse order, depending on the surrounding LTR characters.
Suggested approach
Some possible mitigations at the application level:
- Unicode BiDi control characters — wrap detected RTL text segments with RLM (U+200F) or LRM (U+200E) markers to give terminals a hint about direction.
- Bidi algorithm implementation — apply the Unicode Bidirectional Algorithm (UAX#9) to reorder text before writing to stdout, so the terminal receives already-correctly-ordered glyphs.
- Configuration flag — add an \
tl\\ or \\�idi\\ option that users in RTL locales can enable.
Environment
- opencode CLI (terminal interface)
- Windows Terminal / iTerm2 / etc.
- Hebrew locale / RTL input
References
Problem
When typing or displaying Hebrew (and other RTL scripts) in opencode's CLI interface, the text renders with broken BiDi — characters appear in the wrong visual order because most terminal emulators lack proper bidirectional text support.
This affects a significant user base (Hebrew, Arabic, Persian, Urdu, etc.) and is not a trivial cosmetic issue — it makes the tool unusable for prompts and responses in RTL languages.
Example
Typing Hebrew text in the chat produces output where words appear disjointed or in reverse order, depending on the surrounding LTR characters.
Suggested approach
Some possible mitigations at the application level:
tl\\ or \\�idi\\ option that users in RTL locales can enable.
Environment
References