You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: RTL (Right-to-Left) / Bidirectional text support for TUI input and chat rendering #51005
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Summary
Add support for Right-to-Left (RTL) languages (such as Kurdish, Arabic, Persian, and Hebrew) in the TUI prompt editor and message viewports.
Problem
When typing RTL text (such as Kurdish Sorani کوردی) in the OpenCode TUI prompt input (internal/tui/components/chat/editor.go), characters are rendered Left-to-Right (LTR), causing text to appear mirrored and out of order.
The Charm bubbles/textarea widget used by OpenCode does not perform Unicode Bidirectional Algorithm (UBA) visual reordering before rendering lines to the terminal buffer.
Requested Solution
Apply visual BiDi reordering/reshaping (e.g. using golang.org/x/text/unicode/bidi) in editor.goView() method so RTL character runs render right-to-left within the prompt widget.
Ensure chat response viewports handle RTL/LTR mixed text correctly without corrupting layout.
While core TUI BiDi reordering is being developed, you can use the community plugin opencode-rtl (v1.0.0 is now live on npm) to resolve the chat response and BiDi isolation issues:
Unicode BiDi Isolates (RLI / PDI): Wraps RTL prose so terminals with BiDi support (WezTerm, iTerm2, Windows Terminal, Ghostty) render words and sentences in the correct visual order.
Mixed Code & Text Protection: Protects inline code blocks, commands, and markdown formatting markers from getting inverted inside RTL sentences.
System Prompting: Injects language guidance so the model understands and structures RTL output properly.
Multi-language Support: Automatically detects Kurdish, Persian, Arabic, Hebrew, Urdu, and other RTL scripts.
Activity
razavioo commentedon Sep 30, 2026
While core TUI BiDi reordering is being developed, you can use the community plugin
opencode-rtl(v1.0.0 is now live on npm) to resolve the chat response and BiDi isolation issues:What it handles right now:
Repo: https://github.com/razavioo/opencode-rtl
npm: https://www.npmjs.com/package/opencode-rtl
neriousy commentedon Oct 1, 2026
Closing as a duplicate of #16875. Same request: RTL/bidirectional text in TUI input and chat. Tracking in #16875.