It seems like for at least a decade every application/framework has had their own paste buffer, and honestly I’m surprised this isn’t “just working” out of the box by now.
- Open Terminal
- Run pwgen, double click one of the passwords.
- Middle click in Terminal, the copied password pastes just fine.
- Switch back to Chrome, CTRL-V into the password field.
- Realize 5 minutes later when you can’t login with the user you’ve just created, it’s because the content you pasted into the password field was an URL you copied in Chrome 15 minutes ago.
And don’t even get me started on vim/neovim having yet another copy/paste buffer.
@[email protected]
Linux running X11 has 2 clipboards:
Normally both those clipboards work independent as they are handled by 2 different processes, so you can for example copy one text using ctrl+c and copy another text by only selecting second text, then you can paste both, one with middle click, second with ctrl+v
More and more distro have a clipboard managers that have a feature to “sync” both clipboards, but it’s a lot of time disabled because it’s more confusing people and sometimes annoying. Why it’s confusing and disabled by default? Imagine that you selected some text, then did a ctrl+c, you move to some word document, select text, remove it, and want to Paste it. Guess what, the selecting you did to remove text did copy the selection to clipboard overriding what you did have there from ctrl+c.
Most if not all terminal emulators (konsole, gnome-terminal, xterm) support both clipboard styles, old-school select to copy, and new one but because the “ctrl+c” shortcut reserved to stop/interrupt applications they all decide to use ctrl+shift+c to do a copy. And yes, not only terminal emulators use ctrl+shift+c, I did have few encounters on some random apps, but most of the time, if ctrl+c is used for something else, ctrl+shift+c was available.
I have been using desktop Linux for years and never realized… thanks!
Yes this makes sense. I’ve been using terminals for years with the ‘copy on highlight’ feature enabled, and I’m pretty sure when I was on OSX it was a single buffer.
I can see how having mouse selected text end up in the buffer on a non-Terminal app would probably not be the desired behavior.
I found ‘autocutsel’ which will keep PRIMARY and CLIPBOARD in sync, however Gnome Terminal doesn’t seem to support ‘copy on highlight’ while Terminator does.
A very comprehensive and complete reply. I did know about the different clip buffers but reading this was still so good because no one was actually explaining it. Thanks