anomalyco / anomalyco/opencode

Bengali graphemes can render outside TUI borders

Open
#46,107 1 comment 1 reaction 1 assignee View on GitHub

@simonklee is already working on this.

Since Aug 29, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
Avg merge
7h 2m
Merged PRs (30d)
384

Description

Description

Bengali text in agent or tool output can drift horizontally and render past the right edge of a TUI panel. OpenCode's logical buffer stays aligned, but a terminal that renders multi-code-point Indic graphemes with a wider cell profile advances farther than OpenTUI 0.4.5 expects.

For the sample below, OpenTUI 0.4.5 measures 12 cells. OpenTUI 0.5.9's unicode-wide profile measures 18 cells. The six-cell difference matches the cumulative rightward drift in the affected output.

Plugins

None

OpenCode version

1.18.25

Steps to reproduce
  1. Start OpenCode in a terminal that renders multi-code-point Indic graphemes with wide cells.

  2. Have an agent or tool print this plain text near the right edge of a bordered output panel:

    বাংলা ভাষায় কথা বলি বাংলা ভাষায় কথা বলি
    
  3. Observe the text and the panel's right border.

Expected: the text wraps inside the panel and the border remains aligned.

Actual: Bengali glyphs drift to the right and can render outside the panel.

Operating System

macOS 26.5.2 (Darwin 25.5.0, arm64)

Terminal

Unknown

Additional context
  • NFC and NFD are identical for the sample, so normalization is not the cause.
  • Plain text follows the same width path, so Markdown and ANSI splitting are not required to reproduce the mismatch.
  • OpenCode's current dev branch pins @opentui/core, @opentui/keymap, and @opentui/solid to 0.4.5.
  • OpenTUI fixed a related Ghostty wide-grapheme mismatch in anomalyco/opentui#1415, reported as anomalyco/opentui#1401. The fix is included in OpenTUI 0.5.9.
  • OpenCode's v2 branch already pins OpenTUI 0.5.9. A safe stable backport or dependency upgrade may therefore be preferable to application-level clipping.
Acceptance criteria
  • The Bengali sample remains inside the tool-output panel.
  • The right border remains aligned after wrapping, redraw, and terminal resize.
  • Existing ASCII and CJK rendering does not regress.

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.