anomalyco / anomalyco/opencode
RTL/bidi broken for mixed Arabic-script + Latin text in TUI
@kommander is already working on this.
Since Aug 3, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Environment: opencode 1.18.11, Windows, reproduced identically in both Windows Terminal and the desktop app.
Any line containing both Persian/Arabic (RTL) and an embedded Latin word (LTR) renders in scrambled order instead of correct right-to-left. Pure single-direction lines render fine.
The TUI appears to lay text out cell-by-cell in a monospace grid without applying the Unicode bidi algorithm, so directional runs within a line are not reordered correctly. Since this reproduces identically across terminals, it is the opencode renderer, not the terminal.
Example: a Persian sentence containing an embedded Latin token (e.g. a filename or config key) renders with wrong character order wherever the Latin token sits mid-Persian.
There is no config option for this (checked the config schema - no rtl/bidi/direction field). Please add proper Unicode bidi handling (and ideally RTL shaping) to the TUI text renderer.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.