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
RTL language support (Persian/Arabic) - characters appear reversed and disconnected #16875
I'm using OpenCode on Windows with WezTerm terminal and Persian (Farsi)
text is not displayed correctly. The characters appear reversed and
disconnected (not joined properly).
RTL languages like Persian and Arabic require proper Bidi (bidirectional)
text rendering support in the TUI.
Please add RTL/Bidi text support so Persian and Arabic users can use
OpenCode properly.
Thank you!
Plugins
No response
OpenCode version
No response
Steps to reproduce
No response
Screenshot and/or share link
Operating System
Windows 11
Terminal
WezTerm
Reacted by AhmedMahmoud113, Hassan Neama and Morteza Honar
I'd like to investigate this issue and work on a fix.
I'm currently helping with Arabic/RTL improvements and would like to start by reproducing the problem and documenting affected areas before proposing changes.
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
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 renderer (like CSS dir="rtl" as discussed in this issue, or native alignment in the CLI TUI).
Streaming: It formats the text after the response completes. (We are proposing a streaming hook to fix this).
The reversed/disconnected characters issue happens because the terminal doesn't know which segments are RTL. The opencode-rtl plugin fixes this by wrapping RTL segments with Unicode bidi isolation characters.
This was filed before OpenCode 2 was released, so it's about OpenCode v1 (versions 0.x/1.x). v1 now only gets fixes for critical bugs, so RTL/bidi rendering is unlikely to be added there.
We'd encourage you to upgrade to v2 (@opencode/cli, the opencode command). The v2 desktop/web app has RTL support (#40372). The v2 terminal UI doesn't handle bidirectional text yet, though, so in the terminal Persian/Arabic may still look wrong.
In the meantime, the community plugin opencode-rtl mentioned above may help. It adds bidi isolation marks to responses, which fixes much of the character ordering but not the alignment.
Closing this as not planned. The report is about OpenCode v1, which only gets critical fixes, and we didn't hear back about whether it also happens on v2.
The v2 terminal UI doesn't render RTL text properly yet either. If you see this on v2, please open a new issue with your opencode --version output. You can also try the community plugin opencode-rtl, which fixes much of the character ordering. Thanks again for reporting it!
Activity
github-actions commentedon Mar 10, 2026
This issue might be a duplicate of existing issues. Please check:
Please review these issues and consider commenting on an existing one if it covers your use case.
fix: RTL text layout support in web UI (anomalyco#16875)
hbx12 commentedon May 30, 2026
I'd like to investigate this issue and work on a fix.
I'm currently helping with Arabic/RTL improvements and would like to start by reproducing the problem and documenting affected areas before proposing changes.
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:
dir="rtl"as discussed in this issue, or native alignment in the CLI TUI).Repo: https://github.com/razavioo/opencode-rtl
razavioo commentedon Sep 27, 2026
The reversed/disconnected characters issue happens because the terminal doesn't know which segments are RTL. The opencode-rtl plugin fixes this by wrapping RTL segments with Unicode bidi isolation characters.
Install:
Configure (
opencode.json):{ "plugin": [["opencode-rtl", { "language": "fa" }]] }Or for OpenCode 2:
{ "plugins": [{ "package": "opencode-rtl", "options": { "language": "fa" } }] }Important: your terminal must support Unicode bidi rendering. Recommended terminals: WezTerm, iTerm2, Windows Terminal, or Ghostty.
opencodejr commentedon Oct 29, 2026
Thanks for the report and the screenshot!
This was filed before OpenCode 2 was released, so it's about OpenCode v1 (versions 0.x/1.x). v1 now only gets fixes for critical bugs, so RTL/bidi rendering is unlikely to be added there.
We'd encourage you to upgrade to v2 (
@opencode/cli, theopencodecommand). The v2 desktop/web app has RTL support (#40372). The v2 terminal UI doesn't handle bidirectional text yet, though, so in the terminal Persian/Arabic may still look wrong.In the meantime, the community plugin
opencode-rtlmentioned above may help. It adds bidi isolation marks to responses, which fixes much of the character ordering but not the alignment.Related issues:
If you think this is critical, or you see the same problem on v2, please reply here with your
opencode --versionoutput.opencodejr commentedon Oct 30, 2026
Closing this as not planned. The report is about OpenCode v1, which only gets critical fixes, and we didn't hear back about whether it also happens on v2.
The v2 terminal UI doesn't render RTL text properly yet either. If you see this on v2, please open a new issue with your
opencode --versionoutput. You can also try the community pluginopencode-rtl, which fixes much of the character ordering. Thanks again for reporting it!