How to Stop Ubuntu from Automatically Clearing the Clipboard

The Ephemeral Clipboard

Ubuntu’s default desktop environment, GNOME, handles clipboard data differently than Windows or macOS. Historically in the X11 display server (and persisting in some ways under Wayland), there is the “primary selection” (what you highlight) and the “clipboard” (what you explicitly copy). However, a major frustration for new users is that when you highlight text in an application, press Ctrl+C, and then close that specific application, Ubuntu often automatically clears the clipboard. If you copied a URL from Firefox, closed Firefox, and then tried to paste it into a terminal, you will find the clipboard is completely empty.

Installing a Clipboard Manager

To ensure your copied data survives the closure of its parent application and stop Ubuntu from automatically clearing the clipboard, you must install a dedicated background clipboard manager daemon.

By far the easiest way to solve this in modern Ubuntu (GNOME) is to install a GNOME Shell Extension. Open the Ubuntu Software center (or use the web-based GNOME extensions portal if you have the connector installed). Search for an extension named Clipboard Indicator (by Tudmotu) or Pano. Install the extension and enable it. These tools run a tiny daemon in the background that intercepts anything you copy and stores it independently of the source application. Now, if you copy text and close the app, the background manager holds onto the data, allowing you to paste it anywhere. As a bonus, these tools usually give you a history of your last several dozen copies, accessible from a small icon in the top panel.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.