I cannot believe that in this the year of our lord 2025 we still have two separate clipboard buffers on desktop Linux.
There are very few cases where I will execute a paste (whether it is with middle click or Ctrl-V) and I will want the resulting paste to be anything other than the last thing I copied. Whatever X11 subcommittee came up with the idea that users would want to juggle stuff between the two buffers, or whatever the fuck the thinking was, needs to be punished physically. It’s not enough to tell them: They need to remember, so that they will know what they did was wrong, and get fearful in the future if they ever think of doing anything like that again. Their names should be made public, so that people in the future who might want to hire them will know what they did. (I tried to find out who it was, but Google is drunk again and couldn’t really tell me all that much.)
I am already aware that the X11 people spent a lot of time huffing glue in between creating overly complicated standards documents. So maybe the fact that they made some baffling and wrong decisions for literally no reason isn’t surprising. It was a long time ago, a lot of bad things happened back then. What I really cannot understand is why Wayland looked at that decision, and the long history of pain and suffering it had caused over the years, and decided, “You know what? Let’s keep that around. What harm could it do? And anyway… it’s compatible!”
Having two clipboards is literally just worse. They did extra work, and enforced extra work on every programmer and every user, just to make things worse. If anyone knows of something I can run that will just do a simple bidirectional sync between the two clipboards, so I can just pretend to myself that all of this isn’t happening, please tell me. I tried to find a solution for half the morning so far, because I finally just got enraged by it, and I couldn’t find one.
If I imagine hard to myself, I can maybe imagine a scenario where I might want to hit Ctrl-C, then I would accidentally highlight something right after, and then I would want to paste the thing I did Ctrl-C for. But surely that use case isn’t the one that we need to wrap the whole desktop Linux clipboard situation around, to make sure that Fat-Finger Freddy can still get his pasting done, all while the rest of us have to go around saying things like “wl-paste -p -w ‘wl-copy’” and everyone has to do a bunch of extra work whenever they want to do the already difficult task of making pasting work in an editor over SSH or something.
I literally can’t believe how bad it is. It’s like a prank. It’s like one of those imaginary programming languages where someone invented a deliberately malicious feature and then implemented it to a T to be funny.
I do not like it. Not one bit.
Also: Did you know there’s a secondary selection? There are actually three clipboards. Emacs is only editor in history that does anything with the third one. Hold down “alt” and drag with the left button to highlight something, and it’ll go into the top secret secondary clipboard, where nothing else will ever see it.
OH HOW USEFUL
SAID NO ONE EVER
PhilipTheBucket@ponder.cat 3 days ago
Okay, if anyone is curious: I finally lost so much patience with all of this that I fought with it until it was actually doing what I want. It took far longer than it should have.
Here was the secret sauce, for my setup at least:
Wayland needs running in the background:
wl-paste -w sh -c 'wl-copy -p'
So what that does is send anything from CLIPBOARD to PRIMARY, so I can click “copy to clipboard” on a web page and still middle-click to paste it. I actually don’t care as much about the other way (which is good because it seems like it might cause an infinite loop); @Riskable@programming.dev you can rest easy that the Ctrl-V buffer won’t be affected by highlighting text and I can still do paste of whatever I wanted to, even if I highlighted in the middle.
Then in Helix config on any remote machine, have:
That’s what enables us to highlight text in Helix and have it make it back to the local system’s clipboard. I actually don’t know which clipboard it’s going into there, and thanks to
wl-paste
, I don’t have to care.Then, in kitty config on the local system, have:
That means that we disable all efforts which Helix will make to grab the middle-click event and fuck it up in some way or other. Kitty pastes the text, Helix receives it, and we have the nice side benefit that it goes in where the cursor is instead of at whatever random position I have let the pointer wander over to before I did the middle click.
Hallelujah. I can get back to actual work. Boy this wasn’t a big extensive confusing waste of time involving extra difficulty that didn’t need to be there. Great. Great.