How do I disable the auto-copy-on-select feature of gnome-terminal?

7

1

Recently I found the auto-copy on selection feature of gnome-terminal really annoying. However, I tried to look for a way to disable it. As it turns out, there's few documentation for that. I was wondering if there's a way to disable this feature?

Frank

Posted 2010-10-19T23:34:28.507

Reputation: 730

Answers

-2

That's not gnome-terminal doing that, it's X. And there's no way to disable it since "copying" in modern environments is just copying the PRIMARY selection to the CLIPBOARD selection therefore disabling it would prevent any copying at all. Just learn to not hit the middle mouse button.

Ignacio Vazquez-Abrams

Posted 2010-10-19T23:34:28.507

Reputation: 100 516

1Why is this even the default behavior? Even now, 7,5 years later, there is no option to disable the automatic copy. This is a dangerous feature and could possibly end up copying classified information. Some people use selection to make text more readable, i.e white text och black background. Selecting the text makes it easier to read, which doesn't mean the user wants to copy the text... Having copied text in clipboard could lead to unintentional pastes, and with today's auto save features to prevent work loss, classified info could potentially be persisted to a remote storage database... – Daniel – 2018-03-02T12:04:10.207

2

Could you elaborate on that? According to Gnome Terminal Manual (http://library.gnome.org/users/gnome-terminal/stable/gnome-terminal-usage.html.en ): "For all text selections, GNOME Terminal copies the selected text into the clipboard when you release the mouse button." Also, I wasn't using mouse middle button at all, just normal clicks.

– Frank – 2010-10-20T00:00:37.857

I'm not seeing the documented behavior, just what X normally does. – Ignacio Vazquez-Abrams – 2010-10-20T00:04:15.123

@Daniel Another potential danger: what if you had seen rm -rf /* on a website or something, at the end of a line, and you selected something containing it. Then one accidental middle click in the terminal, perhaps while trying to scroll, and all your files will be gone. – flarn2006 – 2019-10-27T03:22:54.053

1My X server doesn't copy on select, nor paste on middle click. Now, if I could just track down how I did it.... – Coderer – 2011-03-11T22:38:43.110

1@coderer If you figure it out, please let me know! My touchpad likes to throw spurious middle clicks from time to time, so that combined with my habit of selecting text as I read leads to unwanted pastes from time to time (~daily). – Drooling_Sheep – 2011-03-23T01:37:04.360

0

If you want to prevent X clients from accessing the PRIMARY selection (i.e. when "copying" is done by merely selecting text and "pasting" is usually done by middle-clicking), I added an option for this to hax11:

https://github.com/CyberShadow/hax11 (see NoPrimarySelection)

To enable it, install hax11, and in ~/.config/hax11/profiles/default, add:

Enable=1
NoPrimarySelection=1

Vladimir Panteleev

Posted 2010-10-19T23:34:28.507

Reputation: 775