Skip to content

TUI long prompt text overflows while scrolling #49341

Closed as not planned
Closed as not planned

Description

@tomg55555

Description

Long prompts can render outside the expected TUI composer/message layout and cause visible flickering/overflow while using the TUI.

On opencode 1.18.31, entering a long prompt and scrolling in the TUI can make part of the prompt appear outside the expected prompt area. The long text appears to escape or clip through the layout while the composer/status area remains visible, producing visible flickering and overflow.

This appears to be a TUI layout/height-clamping or redraw issue for long wrapped prompt text while scrolling.

Plugins

@opencode-ai/plugin 1.4.6

OpenCode version

1.18.31

Steps to reproduce

  1. Use opencode 1.18.31 in the TUI.
  2. Paste or type a long prompt, for example several thousand characters of normal prose without manual line breaks.
  3. Submit the prompt.
  4. Scroll the TUI while the long prompt is in the conversation history.
  5. Observe that long prompt text can visually overflow/flicker outside the expected prompt/message area instead of staying clipped within the layout.

Screenshot and/or share link

Screenshot shows long prompt text overflowing near the top of the visible TUI while the composer/status area remains at the bottom.

TUI long prompt overflow

Operating System

macOS 26.6.2 arm64

Terminal

Ghostty (TERM=xterm-ghostty). Reproduction capture used TERM=xterm-256color with COLUMNS=80 and LINES=24.

Activity

  1. changed the title [-]TUI overflows/flickers when reopening sessions with long prompts[/-] [+]TUI overflows/flickers when scrolling long prompts[/+] on Sep 16, 2026
  2. changed the title [-]TUI overflows/flickers when scrolling long prompts[/-] [+]TUI long prompt text overflows while scrolling[/+] on Sep 16, 2026
  3. tomg55555 commented on Sep 30, 2026

    @tomg55555
    Author

    Reporter follow-up with verification and the current state on 1.x and 2.x.

    1.18.x: fixed by #49344. I verified the PR build locally in the full-screen terminal where I hit this: the stray bar next to the status line no longer appears while scrolling. In pty captures replayed through a terminal emulator at 204x52, 5 of 11 committed frames had the bar without the patch, and 0 of 10 with it. The UserMessage box is still unchanged in 1.18.33, so released 1.x is still affected until the PR lands.

    2.0.20: not reproducible with opaque themes, still reproducible with transparent ones. In 2.x the UserMessage bordered box has backgroundColor={theme.background.raised.base}. That keeps it off the opentui path that ignores the scroll viewport's clip. I ran the released 2.0.20 binary against a session with long user messages, scrolling with the wheel and PgUp/PgDn:

    theme size committed frames with the bar
    catppuccin 204x52 0 / 23
    catppuccin 120x40 0 / 23
    system 204x52 0 / 24
    lucent-orng 204x52 12 / 22

    lucent-orng sets backgroundPanel to transparent, so background.raised.base resolves to alpha 0 and the bar comes back in the gap above the composer and below the status line. The same applies to any custom theme with a transparent panel background.

    Root cause is upstream. @opentui/core skips the scissor rect in drawBox when the background is fully transparent. It still reproduces on 0.5.13 (used by the v2 branch) and on opentui main. It is tracked in anomalyco/opentui#1311, with a fix in anomalyco/opentui#1352. I added a minimal reproduction there. Once that lands, both 1.x and the transparent-theme case in 2.x are covered.

  4. thdxr commented on Oct 11, 2026

    @thdxr
    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