anomalyco / anomalyco/opencode
TUI leaves stale "ghost" characters on screen in Termux, only cleared by forced full redraw
@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:
- Run opencode in Termux
- Trigger UI updates where line length shrinks
- Observe leftover/ghost characters
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.