Skip to content

Bengali graphemes can render outside TUI borders #46107

Closed as not planned
Closed as not planned

Description

@Blackman99

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 terminal: match Ghostty wide grapheme widths opentui#1415, reported as Malayalam graphemes render at incorrect cell positions 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.

Activity

  1. 2u841r commented on Sep 3, 2026

    @2u841r

    Thanks for opening this issue.

  2. Tarquinen commented on Oct 20, 2026

    @Tarquinen
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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