feat(tui): Full RTL/Bidi support for Persian, Arabic, Hebrew, and Urdu text
Problem
Persian, Arabic, Hebrew, and Urdu text renders left-aligned with disconnected letters in the Hermes TUI (hermes --tui). This makes the TUI unusable for ~500M+ potential users across Iran, the Middle East, North Africa, Pakistan, and Israel.
Currently:
- 🇮🇷 Chat messages render LTR (left-aligned) regardless of content
- 🔤 Persian/Arabic script letters are disconnected (isolated forms instead of cursive)
- 📌 Gutter glyph (▸ / ⚕) stays fixed on left for all languages
- ⌨️ Input field has no RTL cursor direction support
- 📝 Markdown blocks ignore text direction
Proposed Solution
Phase 1: Chat Message RTL (MVP)
Phase 2: Full Bidi
Phase 3: Configuration
Implementation Notes
The fix is straightforward — a working prototype already exists as a local patch:
- Add RTL detection regex to
messageLine.tsx
- Insert
flexDirection={rtl ? 'row-reverse' : 'row'} on the message row
- Add
alignItems={rtl ? 'flex-end' : 'flex-start'} on the content box
Impact
- Iran: ~90M Persian speakers
- Arab world: ~400M Arabic speakers
- Israel: ~9M Hebrew speakers
- Pakistan: ~230M (Urdu uses Arabic script)
- Afghanistan: ~40M (Dari/Pashto)
Related Issues
feat(tui): Full RTL/Bidi support for Persian, Arabic, Hebrew, and Urdu text
Problem
Persian, Arabic, Hebrew, and Urdu text renders left-aligned with disconnected letters in the Hermes TUI (
hermes --tui). This makes the TUI unusable for ~500M+ potential users across Iran, the Middle East, North Africa, Pakistan, and Israel.Currently:
Proposed Solution
Phase 1: Chat Message RTL (MVP)
\u0600-\u06FFArabic/Persian,\u0590-\u05FFHebrew,\u0750-\u077FArabic Supplement)flexDirection: "row-reverse"for RTL message rowsalignItems: "flex-end"for RTL message contentPhase 2: Full Bidi
Phase 3: Configuration
display.rtl_enabled: true/falsein config.yamlImplementation Notes
The fix is straightforward — a working prototype already exists as a local patch:
messageLine.tsxflexDirection={rtl ? 'row-reverse' : 'row'}on the message rowalignItems={rtl ? 'flex-end' : 'flex-start'}on the content boxImpact
Related Issues