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
Persian/Arabic (RTL) text is not displayed correctly in opencode TUI #32984
I work on a Persian RAG system and sometimes type or display Persian text in opencode. The text comes out garbled. Characters appear in the wrong order and letters are disconnected instead of forming proper ligatures. Mixed Persian and English text is unreadable. This makes opencode unusable for any conversation involving Persian or Arabic.
Steps to reproduce:
opencode
Type Persian text like سلام دنیا in the input field
Characters appear disconnected or in the wrong visual order
I saw existing issues #16875 and #26915 about RTL support. My report is specifically about Persian text used in a RAG workflow: typing Persian in the input field and displaying Persian responses from the AI, both of which are broken in the TUI.
Thanks for updating the issue! It now includes all the required information — version, OS, terminal, clear reproduction steps, and a concise description. The report looks good.
For those looking for RTL support, we've built an OpenCode plugin that automatically applies Unicode bidi isolation (RLI/LRI/PDI) to the AI's responses and system prompts.
Injects RTL system prompts so the AI responds in your language
Protects inline code (console.log()) and markdown blocks from getting scrambled by wrapping them in LTR isolates
Works out-of-the-box for Arabic, Persian, Hebrew, Urdu, etc.
Fixes character ordering and mixed-direction (BiDi) text issues in the TUI/CLI
Current limitations:
Right-alignment: The plugin fixes the ordering of words and code (which fixes a lot of the unreadable output), but the text is still left-aligned. Full right-alignment requires native support in the TUI renderer.
Streaming: It formats the text after the response completes. (We are proposing a streaming hook to fix this).
This can be addressed today using the opencode-rtl plugin. It isolates Persian/Arabic text with Unicode bidi characters so terminals render them correctly.
Activity
github-actions commentedon Jun 19, 2026
Thanks for updating the issue! It now includes all the required information — version, OS, terminal, clear reproduction steps, and a concise description. The report looks good.
nkhayatei commentedon Jun 24, 2026
i have same problem with type Farsi or Arabic
razavioo commentedon Jul 29, 2026
Community plugin available:
opencode-rtlFor those looking for RTL support, we've built an OpenCode plugin that automatically applies Unicode bidi isolation (RLI/LRI/PDI) to the AI's responses and system prompts.
What it fixes today:
console.log()) and markdown blocks from getting scrambled by wrapping them in LTR isolatesCurrent limitations:
Repo: https://github.com/razavioo/opencode-rtl
razavioo commentedon Sep 27, 2026
This can be addressed today using the opencode-rtl plugin. It isolates Persian/Arabic text with Unicode bidi characters so terminals render them correctly.
For OpenCode 2:
{ "plugins": [{ "package": "opencode-rtl", "options": { "language": "fa" } }] }For OpenCode 1:
{ "plugin": [["opencode-rtl", { "language": "fa" }]] }It also injects system guidance so the model structures its RTL responses properly (code blocks stay LTR, prose is isolated with bidi markers).
neriousy commentedon Oct 1, 2026
Closing as a duplicate of #16875, which tracks Persian/Arabic (RTL) text rendering in the TUI. Please add your terminal details there.
In the meantime, the community
opencode-rtlplugin mentioned there may help.