anomalyco / anomalyco/opencode

Support RTL/BiDi text rendering in CLI output

Open
#38,524 3 comments 0 reactions 1 assignee View on GitHub

@kommander is already working on this.

Since Jul 23, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Problem

When typing or displaying Hebrew (and other RTL scripts) in opencode's CLI interface, the text renders with broken BiDi — characters appear in the wrong visual order because most terminal emulators lack proper bidirectional text support.

This affects a significant user base (Hebrew, Arabic, Persian, Urdu, etc.) and is not a trivial cosmetic issue — it makes the tool unusable for prompts and responses in RTL languages.

Example

Typing Hebrew text in the chat produces output where words appear disjointed or in reverse order, depending on the surrounding LTR characters.

Suggested approach

Some possible mitigations at the application level:

  1. Unicode BiDi control characters — wrap detected RTL text segments with RLM (U+200F) or LRM (U+200E) markers to give terminals a hint about direction.
  2. Bidi algorithm implementation — apply the Unicode Bidirectional Algorithm (UAX#9) to reorder text before writing to stdout, so the terminal receives already-correctly-ordered glyphs.
  3. Configuration flag — add an \
    tl\\ or \\idi\\ option that users in RTL locales can enable.

Environment

  • opencode CLI (terminal interface)
  • Windows Terminal / iTerm2 / etc.
  • Hebrew locale / RTL input

References

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.