[PR #13599] fix(opencode): prevent freeze on control-heavy paste #14732

Open
opened 2026-02-16 18:19:30 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/13599

State: open
Merged: No


Pasting text that contains lots of control characters (ex: U+001C) can freeze the TUI (CPU pegged, UI stops responding).

This patches paste handling to scrub ANSI/control bytes before emitting the paste event, avoiding Bun.stripANSI() perf cliffs.

Tested manually by pasting the problematic text into the prompt.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/13599 **State:** open **Merged:** No --- Pasting text that contains lots of control characters (ex: U+001C) can freeze the TUI (CPU pegged, UI stops responding). This patches paste handling to scrub ANSI/control bytes before emitting the paste event, avoiding Bun.stripANSI() perf cliffs. Tested manually by pasting the problematic text into the prompt.
yindo added the pull-request label 2026-02-16 18:19:30 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14732