How to toggle or turn off text selection being sent to the clipboard

I would like to disable the default behavior that seems to happen with every Linux distribution that I’ve ever tried that any selected text is immediately sent to the clipboard (Mint, Ubuntu, Fedora, SuSE, etc.) and every window manager (Gnome, KDE, Cinnamon), and instead to behave more like the Windows implementation.

I know that this is a beloved behavior by many in Linux, and I’m sure many will think I’m an idiot. The reason I want to do this, is that I’m a keyboard junky when navigating a GUI. (e.g. when I’m in Linux and I copy a URL and then switch to my browser and type Ctrl+L, it selects the address bar and moves my intended paste down one notch and replaces it with what I’m trying to overwrite.) I know there are MANY workarounds, but I don’t really care about that, what I’d prefer is to be able to toggle the behavior for the clipboard.

Asked By: syserss


First a misconception:

any selected text is immediately sent to the clipboard

Actually text is never “sent” anywhere until it is requested by a receiving application. When you select text, the application only claims the selection, which means basically that it raises a flag to say that from now on it owns it.

Now on to your question:

In X11 there can be multiple selections. 2 of them have well-known names and are standardized. They are called PRIMARY and CLIPBOARD. Their respective conventional behaviors are as follows:

    • Applications claim PRIMARY when text is selected
    • Applications request PRIMARY from the owning application and paste its contents on middle click.
    • Applications claim CLIPBOARD when an explicit command is given, typically Ctrlc.
    • Applications request CLIPBOARD from the owning application and paste its contents when an explicit command is given, typically Ctrlv.
    • There might be additional rules I’m unsure about, like if no application owns CLIPBOARD but some application owns PRIMARY, paste primary instead upon Ctrlv.

It seems like CLIPBOARD already does what you need. You can ignore PRIMARY if you want (but note that some older applications like xterm may only support PRIMARY). Personally I do the opposite: I ignore CLIPBOARD and use only PRIMARY. I guess that’s just the way I learned to use X11, I wasn’t even aware that there was CLIPBOARD at first. But in order to mitigate the problem you describe, I often wish there was a pushable & poppable stack of PRIMARY selections, so I could “pop” to the previous selection after clobbering it with a different one.

In response to your explicit question about whether the PRIMARY behaviour can be disabled, I think that would be quite difficult. The most straightforward way would be to individually disable it in each application (or toolkits which the applications use) which is surely not feasible. I suppose a kind of “X11 firewall” which blocks requests to claim PRIMARY could be constructed, but I don’t think that would really buy you anything more than you can already get by ignoring PRIMARY and using CLIPBOARD only.

More information: What’s the difference between Primary Selection and Clipboard Buffer?

Answered By: Celada

I was messing around and accidentally enabled the Synchronize contents of the clipboard and the selection option in KDE Plasma’s Clipboard application. Un-checking this solved a similar problem for me.

KDE Plasma Clipboard utility configuration

Answered By: Batandwa

For all Gnome applications the Middle Click Paste can be disabled from Gnome-Tweaks/Keyboard & Mouse/Middle Click Paste (which toggles the gtk-enable-primary-paste Gnome option).

A solution working for the whole X and not disabling completely the middle click (e.g. for closing tabs in the browser) is XMousePasteBlock which should be run by the user, it is also packaged for Arch in AUR.

Answered By: Ilario Gelmetti

In XFCE I had the same problem, and the worse was that the auto selection break the copy/paste in remote viewers like x2go, vnc… then I had to reopen a new session to solve it every time I select a text.

run xfce4-clipman from shell, right click in task bar and select propreties, then disable Ignore selections and Sync selections

enter image description here

thanks to for this method

Answered By: Badr Elmers
Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.