Skip to content

RTL/bidi broken for mixed Arabic-script + Latin text in TUI #40286

Description

@rahgozar94725

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.

Activity

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