You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Add support for Linux PRIMARY selection (middle-click paste) #43176
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Description
Currently, the TUI only targets the CLIPBOARD selection when copying text. On Linux, this means that while Ctrl+C/V works, the native "highlight to copy" and "middle-click to paste" behavior (PRIMARY selection) is not supported.
This makes the TUI feel non-native on Linux environments.
Proposed Solution
Introduce a new configuration option linux_clipboard_selection in the TUI config with the following values:
clipboard: Standard Ctrl+C/V (current behavior)
primary: Targets the middle-click buffer
both: Updates both buffers simultaneously (recommended default)
This requires using xclip, xsel, or wl-copy to explicitly target the primary selection.
If you reopened this because #29963 was closed without resolution, please consider commenting on the original issue to request it be reopened, or provide additional context here about why a new issue is warranted.
If you reopened this because #29963 was closed without resolution, please consider commenting on the original issue to request it be reopened, or provide additional context here about why a new issue is warranted.
The original issue closure comment literally instructs to open new issue: "If the issue is still relevant please open a new one."
yes, copy and pasting out of opencode is wild. nothing else has this problem in linux and hijacks copy/pasting this way. I get the feeling that a windows user thought that highlight-to-copy was a cool idea, so they implemented it themselves from scratch. Which, it is a cool idea. but by doing their custom thing, they're overriding that we already have a way to do this in linux, and we use two clipboards, and they're completely breaking that functionality.
likewise with pasting, I constantly have my flow broken trying to figure out how to paste in when I go to middle click paste and it doesn't work and then I have to figure out how to paste in to opencode.
I honestly never realized ctrl+shift+v could paste into the terminal after all these years. I just was middle click pasting. I learned that feature just because of opencode.
but that's still not a substitute for beaking the os. this feature is critical.
Thanks for opening this again, @bornmw! The request: when you copy text in the TUI (including copy-on-select), it should also (or instead) go to the Linux PRIMARY selection so middle-click paste works. You suggest a linux_clipboard_selection option with clipboard, primary and both.
Right now the TUI only reads from and writes to the CLIPBOARD selection (packages/tui/src/clipboard.ts), so this is new behaviour rather than a bug. Maintainers will consider it.
Activity
github-actions commentedon Aug 18, 2026
This issue might be a duplicate of existing issues. Please check:
If you reopened this because #29963 was closed without resolution, please consider commenting on the original issue to request it be reopened, or provide additional context here about why a new issue is warranted.
bornmw commentedon Aug 18, 2026
The original issue closure comment literally instructs to open new issue: "If the issue is still relevant please open a new one."
kylebakerio commentedon Aug 21, 2026
yes, copy and pasting out of opencode is wild. nothing else has this problem in linux and hijacks copy/pasting this way. I get the feeling that a windows user thought that highlight-to-copy was a cool idea, so they implemented it themselves from scratch. Which, it is a cool idea. but by doing their custom thing, they're overriding that we already have a way to do this in linux, and we use two clipboards, and they're completely breaking that functionality.
likewise with pasting, I constantly have my flow broken trying to figure out how to paste in when I go to middle click paste and it doesn't work and then I have to figure out how to paste in to opencode.
I honestly never realized ctrl+shift+v could paste into the terminal after all these years. I just was middle click pasting. I learned that feature just because of opencode.
but that's still not a substitute for beaking the os. this feature is critical.
luckily this looks likely to be merged: #32370
bornmw commentedon Sep 22, 2026
#32370 still not merged, but I've been running it locally for over a month now, it's amazing
donbowman commentedon Sep 23, 2026
I too am somewhat desperate to get #32370 merged, its so awful as it is.
opencodejr commentedon Oct 28, 2026
Thanks for opening this again, @bornmw! The request: when you copy text in the TUI (including copy-on-select), it should also (or instead) go to the Linux PRIMARY selection so middle-click paste works. You suggest a
linux_clipboard_selectionoption withclipboard,primaryandboth.Right now the TUI only reads from and writes to the
CLIPBOARDselection (packages/tui/src/clipboard.ts), so this is new behaviour rather than a bug. Maintainers will consider it.Related issues:
axeluhl commentedon Oct 30, 2026
Copilot's CLI has exactly the same issue on a GNOME terminal.