Skip to content

feat(opencode): add linux_clipboard_selection config for primary buff…#29967

Open
bornmw wants to merge 1 commit into
anomalyco:devfrom
bornmw:feat/linux-clipboard-selection
Open

feat(opencode): add linux_clipboard_selection config for primary buff…#29967
bornmw wants to merge 1 commit into
anomalyco:devfrom
bornmw:feat/linux-clipboard-selection

Conversation

@bornmw
Copy link
Copy Markdown

@bornmw bornmw commented May 30, 2026

…er support (fixes #29963)

Issue for this PR

Closes #29963

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

When I select text in Linux terminal it is expected that it's copied to PRIMARY buffer and I can paste it with a mouse middle button click. Opencode only copies to Clipboard (pasted with Ctrl-V).
Added a config option to selected between Clipboard / Primary / Both (default) and added additional calls to xclip and others.
I implemented Promise.allSettled to update both buffers in parallel

How did you verify your code works?

I select text and selection goes to the configured destination - Clipboard / Primary / Both (default)

Screenshots / recordings

there's no way to record a video that would show difference between pasting via Ctrl-V and middle button click

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

@github-actions
Copy link
Copy Markdown
Contributor

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

Potential duplicate found:

Why it's related: This PR also addresses the same issue of enabling primary clipboard/middle-click paste support for Linux (X11/Wayland). Both PRs are trying to solve the same problem - copying text to the PRIMARY buffer so it can be pasted with middle-click. You may want to check if PR #6370 is already merged, closed, or if there's overlap in implementation before proceeding.

@bornmw
Copy link
Copy Markdown
Author

bornmw commented May 30, 2026 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Add support for Linux PRIMARY selection (middle-click paste)

1 participant