Add macOS-friendly clipboard fallback #8891

Open
opened 2026-02-16 18:11:06 -05:00 by yindo · 1 comment
Owner

Originally created by @AndersHsueh on GitHub (Feb 9, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

The CLI clipboard helper only runs xclip via Bun, which doesn't exist on macOS without X11.

问题

Bun.which('xclip') merely detects the binary but macOS ships no compatible xclip, so clipboard support never activates.

Suggestion

Add a macOS-friendly fallback (e.g. pbcopy/pbpaste or a cross-platform helper) when xclip is unavailable.

建议

xclip 缺失时,改为调用 pbcopy/pbpaste 或其他跨平台剪贴板工具,确保 macOS 下也能使用剪贴板。

Originally created by @AndersHsueh on GitHub (Feb 9, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description The CLI clipboard helper only runs `xclip` via Bun, which doesn't exist on macOS without X11. ### 问题 `Bun.which('xclip')` merely detects the binary but macOS ships no compatible xclip, so clipboard support never activates. ### Suggestion Add a macOS-friendly fallback (e.g. `pbcopy`/`pbpaste` or a cross-platform helper) when `xclip` is unavailable. ### 建议 当 `xclip` 缺失时,改为调用 `pbcopy`/`pbpaste` 或其他跨平台剪贴板工具,确保 macOS 下也能使用剪贴板。
Author
Owner

@github-actions[bot] commented on GitHub (Feb 9, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #7134: Unable to copy terminal output to clipboard on macOS
  • #7132: Unable to copy terminal output to clipboard on macOS (appears to be duplicate of #7134)
  • #12003: Copy & Newline Not Working in macOS Default Terminal - includes clipboard issues
  • #11996: Clipboard copy broken in terminals without OSC52 support - mentions need for native fallback (osascript on macOS, xclip on Linux)
  • #12039: Copy to clipboard fails on MacOS when using tmux
  • #4283: Copy To Clipboard is not working - general clipboard issues

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Feb 9, 2026): This issue might be a duplicate of existing issues. Please check: - #7134: Unable to copy terminal output to clipboard on macOS - #7132: Unable to copy terminal output to clipboard on macOS (appears to be duplicate of #7134) - #12003: Copy & Newline Not Working in macOS Default Terminal - includes clipboard issues - #11996: Clipboard copy broken in terminals without OSC52 support - mentions need for native fallback (osascript on macOS, xclip on Linux) - #12039: Copy to clipboard fails on MacOS when using tmux - #4283: Copy To Clipboard is not working - general clipboard issues Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8891