[PR #11994] fix: always fall back to native clipboard after OSC52 #14019

Closed
opened 2026-02-16 18:18:50 -05:00 by yindo · 0 comments
Owner

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

State: closed
Merged: Yes


Problem

Clipboard copy stopped working in some terminals after #11744 introduced OSC52 clipboard support.

The issue is that renderer.copyToClipboardOSC52() returns true (indicating it wrote the escape sequence), but the terminal may not actually support or have OSC52 enabled. The previous code would early-return, skipping the native clipboard method.

Solution

Remove the early return so both OSC52 and the native method (osascript on macOS, xclip/wl-copy on Linux) are always attempted. This ensures clipboard copy works reliably across all terminal configurations.

Changes

  • packages/opencode/src/cli/cmd/tui/util/clipboard.ts — remove early return after OSC52

Testing

  • Tested on macOS with iTerm2 (OSC52 disabled)
  • Clipboard copy now works reliably
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/11994 **State:** closed **Merged:** Yes --- ## Problem Clipboard copy stopped working in some terminals after #11744 introduced OSC52 clipboard support. The issue is that `renderer.copyToClipboardOSC52()` returns `true` (indicating it wrote the escape sequence), but the terminal may not actually support or have OSC52 enabled. The previous code would early-return, skipping the native clipboard method. ## Solution Remove the early return so both OSC52 and the native method (osascript on macOS, xclip/wl-copy on Linux) are always attempted. This ensures clipboard copy works reliably across all terminal configurations. ## Changes - `packages/opencode/src/cli/cmd/tui/util/clipboard.ts` — remove early return after OSC52 ## Testing - Tested on macOS with iTerm2 (OSC52 disabled) ✅ - Clipboard copy now works reliably ✅
yindo added the pull-request label 2026-02-16 18:18:50 -05:00
yindo closed this issue 2026-02-16 18:18:50 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14019