In almost all Linux distributions, including Ubuntu, the desktop environment inherits an ancient X11 windowing convention known as “Middle Click Paste.” If you highlight a piece of text anywhere on your screen, it is silently copied to a secondary clipboard. If you then click the middle mouse button (the scroll wheel), that text is instantly pasted into wherever your cursor is resting.
While UNIX veterans swear by this feature, it is incredibly frustrating for users migrating from Windows or macOS. Because the middle mouse button is frequently used to open links in new tabs or close existing tabs in a web browser, slightly slipping and clicking the scroll wheel on a text field will violently paste random strings of text into your documents. You can completely disable this behavior.
How to Turn Off Middle Click Paste in Ubuntu
You must use the GNOME Tweaks tool to alter the desktop’s core mouse behaviors.
- First, ensure you have the necessary tool installed. Open the Terminal (Ctrl + Alt + T) and run:
sudo apt install gnome-tweaks - Once installed, open your application grid and launch the Tweaks app.
- In the left-hand navigation sidebar of the Tweaks window, click on Keyboard & Mouse.
- Look for the section titled “Mouse” in the main window.
- Locate the toggle switch labelled Middle Click Paste.
- Click the toggle switch to turn it completely Off.
The change is instantaneous. The secondary, hidden clipboard is now decoupled from your scroll wheel. You can middle-click to open new tabs or close windows as aggressively as you want without accidentally dumping paragraphs of text into your code editors or chat windows.