anomalyco / anomalyco/opencode

RTL/bidi support for mixed Arabic/English chat output

Open
#40,004 1 comment 0 reactions 1 assignee View on GitHub

@kommander is already working on this.

Since Aug 1, 2026.

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

Description

Problem

When the agent outputs mixed Arabic and English text in the TUI, the bidirectional (bidi) text rendering is broken and hard to read. Arabic text gets interleaved with English in a way that makes the output confusing and unreadable.

Example

When asking a question that requires both Arabic and English in the response, the output looks jumbled:

استخدم `deepseek-v4-flash-free` لأنه أقوى نموذج مجاني

The inline code, English words, and Arabic text don't render in the correct reading order.

Expected Behavior

  • Arabic text should render RTL
  • English text/code should render LTR
  • Mixed content should follow Unicode bidirectional algorithm (UBA) properly
  • The reading order should be natural for bilingual users

Suggestion

  • Integrate a bidi text library (e.g., bidi-js or similar) to properly render mixed-direction text in the TUI
  • Or use a terminal that supports bidi natively and document it

Environment

  • OpenCode TUI
  • Windows (but likely affects all platforms)

Use Case

Many developers work in bilingual environments (Arabic + English) and need clear, readable output when the agent mixes both languages in responses.

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.