How to Stop Ubuntu from Automatically Clearing the Clipboard When You Close an App

If you are coming to Ubuntu Linux from Windows or macOS, you might run into a highly frustrating and confusing quirk regarding how the clipboard works in the X11 display server environment. By default, if you highlight text in a web browser, press Ctrl+C to copy it, and then close the web browser before pasting the text into a document, your clipboard will suddenly be completely empty.

In traditional X11 Linux, the clipboard contents are owned by the application where the text originated. When that application dies, the clipboard data dies with it. This lack of a persistent “clipboard manager” is a common pain point for new Linux users.

To stop Ubuntu from clearing your copied text when you close the source application, you simply need to install a lightweight background clipboard manager.

How to Install a Persistent Clipboard Manager

There are several clipboard managers available for Ubuntu, but one of the most reliable and unobtrusive options for the default GNOME desktop environment is an extension called Clipboard Indicator.

  1. Open the Ubuntu Software application.
  2. Search for an app called Extension Manager (this is much easier than installing extensions via a web browser) and install it.
  3. Open the Extension Manager app you just installed.
  4. Click the Browse tab at the top of the window.
  5. In the search bar, type Clipboard Indicator.
  6. Find the extension created by Tudmotu and click the blue Install button next to it.

How It Works

Once installed, you will see a small clipboard icon appear in the top-right corner of your GNOME top bar. This extension works by constantly listening to your clipboard. Whenever you press Ctrl+C (or right-click copy), the extension immediately saves the data into its own memory.

Because the extension is running as part of the desktop shell (and not the application you copied the text from), you can safely copy a paragraph from Firefox, completely quit Firefox, open LibreOffice, and press Ctrl+V. Your text will paste perfectly.

As a bonus, if you click the clipboard icon in the top bar, you can view your clipboard history and click on older items you copied hours ago to paste them again!

Get the best tech tips delivered straight to your inbox.

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