anomalyco / anomalyco/opencode

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

Open
#47,255 1 comment 0 reactions 1 assignee View on GitHub

@kommander is already working on this.

Since Sep 4, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

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

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.