anomalyco / anomalyco/opencode

Text renderables pass control characters and ANSI escape sequences from content to the terminal verbatim

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

@kommander is already working on this.

Since Sep 6, 2026.

2.0
Dominant language
TypeScript
Stars
209k
Forks
27.5k
Avg merge
7h 2m
Merged PRs (30d)
384

Description

Description

Strings containing C0/C1 control characters or ANSI escape sequences (CSI, OSC) that reach text surfaces are written to the terminal verbatim.
The terminal executes them - cursor movement, erase, colour changes, bell, window title changes - and the rendered frames no longer match the terminal state until a full redraw.

Plugins

No response

OpenCode version

opencode2

Steps to reproduce

Render content containing e.g. "before\u001b[2J\u001b[Hafter". The terminal clears/moves the cursor instead of displaying the text. Same with \r, \x07, \u009b, or an OSC sequence like \u001b]0;title\u0007.

Observed in practice through opencode (which renders on @opentui/core + @opentui/solid 0.4.5): a command whose output grepped binary font files produced content with NUL/BEL/BS/CR/ESC bytes (152 ESC sequences, lines up to ~22,000 characters). Rendering it corrupted the whole TUI - overlapping frames, overprinted fragments, stray highlights - until restart.

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Windows Terminal

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.