Skip to content

Conversation

@MartinWie
Copy link
Contributor

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 ✅

OSC52 may report success but not actually work in some terminals.
Previously, the code would early-return if OSC52 returned true,
skipping the native clipboard method (osascript on macOS).

This change removes the early return so both methods are attempted,
ensuring clipboard copy works reliably across all terminal configurations.
@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@MartinWie
Copy link
Contributor Author

Fixes #11996

@kommander
Copy link
Collaborator

I'll introduce proper remote detection next.

@kommander kommander merged commit 82dd4b6 into anomalyco:dev Feb 3, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants