Skip to content

Hebrew/Arabic (RTL) text renders left-to-right in messages and the composer #32726

Closed as duplicate

Description

@shaharsha

Description

In the desktop app, Hebrew and Arabic text is laid out left-to-right and left-aligned, so RTL content reads incorrectly. Punctuation lands on the wrong side, and list bullets and numbers sit on the wrong side. This affects agent replies, user messages, and the composer input.

OpenCode version

1.17.7 (desktop)

Steps to reproduce

  1. Open the desktop app
  2. Send or receive any message that contains Hebrew or Arabic text

Screenshot and/or share link

Before: Hebrew/Arabic renders left-to-right and left-aligned, with list markers on the wrong side. After the fix: it renders right-to-left with correct alignment and markers, while English and code stay LTR.

Operating System

macOS


The earlier RTL reports (#6284, #9948, #10908) were auto-closed for inactivity rather than resolved, and people are still commenting that it is not solved. The fix is small and CSS-level: unicode-bidi: plaintext plus dir="auto" (a pattern already used in the codebase for file paths), so English content is unaffected. I have a PR ready (#32727).

Activity

  1. github-actions commented on Jun 17, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your issue is distinct or you have a ready fix, please reference these issues in your PR to provide context.

  2. razavioo commented on Jun 21, 2026

    @razavioo

    https://github.com/razavioo/opencode-rtl

    I have created an opencode RTL plugin that solves the most part. feel free to check it out and maybe do some contribution.

  3. Musa85 commented on Jul 4, 2026

    @Musa85

    Detailed root-cause analysis and a fully tested fix recipe (CSS/JS, with before/after screenshots on Desktop 1.17.13) is available in #35319 — covers word ordering, alignment, and table column direction for Arabic/RTL.

  4. razavioo commented on Jul 29, 2026

    @razavioo

    Community plugin available: opencode-rtl

    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.

    npm install opencode-rtl
    // opencode.json
    {
      "plugin": [
        ["opencode-rtl", { "language": "auto" }]
      ]
    }

    What it fixes today:

    • 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).

    Repo: https://github.com/razavioo/opencode-rtl

  5. razavioo commented on Sep 27, 2026

    @razavioo

    While native RTL rendering in OpenCode's TUI is the long-term fix, there is a community plugin that addresses this right now: opencode-rtl.

    It wraps RTL text in Unicode bidi isolation characters (RLI/PDI) so Hebrew and Arabic render correctly in terminals that support Unicode bidi. It also injects system guidance so the model responds with proper RTL formatting.

    For OpenCode 2.x (v1.0.0, being published):

    // opencode.jsonc
    {
      "plugins": [
        {
          "package": "opencode-rtl",
          "options": {
            "language": "auto",
            "isolateUserMessages": "auto",
            "isolateAssistantText": "auto"
          }
        }
      ]
    }

    For OpenCode 1.x ([email protected]):

    {
      "plugin": [["opencode-rtl", { "language": "auto" }]]
    }

    It supports 10 RTL languages (Arabic, Hebrew, Persian, Urdu, etc.), per-column table direction detection, and stream-level assistant text isolation.

  6. neriousy commented on Oct 1, 2026

    @neriousy
    Member

    Closing as a duplicate of #26915, which tracks RTL (Hebrew, Arabic, Persian) support in the desktop chat. Please add your details and 👍 there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions