Skip to content

TUI leaves stale "ghost" characters on screen in Termux, only cleared by forced full redraw #47255

Closed as not planned

Description

@aydemir

Description

On Termux (Android), during normal opencode TUI usage, leftover/duplicated text fragments remain visible on screen after content updates — they are not present in the actual output stream (confirmed by cloning and inspecting logs; PTY data is clean). The artifacts disappear only when the terminal is forced to fully redraw — e.g. rotating the screen (which triggers a resize/WindowSizeMsg). This strongly suggests the Bubbletea (v2) standard renderer's line-diffing doesn't fully erase the previous line before writing shorter new content in this terminal environment, possibly due to a character-width mismatch (icons/Nerd Font glyphs/emoji) between what Bubbletea assumes and how Termux's terminal-view renders them.

Repro:

  1. Run opencode in Termux
  2. Trigger UI updates where line length shrinks
  3. Observe leftover/ghost characters
  4. Rotate the screen → artifacts clear (full redraw via WindowSizeMsg)

Additional context:

  • opencode TUI is built on Go + Charmbracelet Bubbletea (v2)
  • Bubbletea's standard (non-alt-screen) renderer only diffs and overwrites changed lines rather than clearing the full screen
  • Screen rotation changes terminal size → triggers WindowSizeMsg → full clear + redraw
  • Related project that may have seen similar issues: wallentx/opencode-termux

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. github-actions commented on Sep 4, 2026

    @github-actions
    Contributor

    This issue might be related to an existing Termux TUI issue. Please check:

    It would also help maintainers to fill in the OpenCode version, Operating System, and Terminal fields in the issue template if you haven't already.

  2. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    Thanks for reporting this! Before we can look into it, we need a few more details:

    • OpenCode version: the output of opencode --version, and how you installed it in Termux (npm @opencode/cli, opencode-ai, the wallentx/opencode-termux build, etc.).
    • Environment: Android and Termux versions, and the font you use in Termux (for example a Nerd Font or the default).
    • Steps, in your own words: briefly, which screen or action leaves the ghost characters (for example scrolling a session, streaming a response, opening a dialog), and what you expected to see versus what you saw.
    • A screenshot of the leftover characters, if you can take one.

    A note on the analysis in the report: the current OpenCode TUI isn't built on Go or Bubbletea. It uses OpenTUI, so the Bubbletea renderer explanation probably doesn't apply. That's also why the exact version matters.

    You can reply here with the details or edit the issue. If you edit it, please also leave a short comment saying you've updated it, so we know you're done.

  3. opencodejr commented on Oct 31, 2026

    @opencodejr
    Contributor

    We haven't heard back about the details we asked for: your OpenCode version (opencode --version), how you installed it in Termux, your Android, Termux and font details, the steps that leave the ghost characters, and a screenshot. Without them we can't tell which version this affects or try to reproduce it, so I'm closing this issue for now.

    If it still happens, please reply here with those details and we can reopen it, or open a new issue that includes them. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions