If you have ever copied a command, closed the terminal, and then found the clipboard empty, you have already met the main reason people go looking for clipboard history on Linux. The Linux clipboard is not a storage box. It is a promise from one app to hand over data when another app asks for it, and when that app goes away, so does the promise.
This post explains what happens under the hood on X11 and Wayland, what clipboard managers do about it, and the GUI setup I use to get copied text onto my phone too.
How the clipboard works on Linux (and why copies vanish)
On X11 there is no central clipboard buffer. When you copy, the app announces that it owns a "selection". When you paste, the receiving app asks the owner for the data in a format it understands. Nothing is stored anywhere else.
That design has two side effects developers run into all the time:
- Copied text can disappear. If the owning app exits, there is no owner left to answer the paste request.
- There are two clipboards. X11 has a PRIMARY selection (whatever you last highlighted, pasted with a middle click) and a CLIPBOARD selection (the one you fill with Ctrl+C). They are independent, which is why middle-click paste sometimes gives you something you did not expect.
Wayland keeps the same ownership model, with one big change: apps are isolated. Under the core protocol, only the window that has keyboard focus can read the clipboard. That is good for security and awkward for any tool that wants to watch the clipboard in the background.
What a clipboard manager on Linux actually does
A clipboard manager fixes both problems by acting as a permanent participant. It watches for new selections, copies the data into its own history, and can take ownership itself so the content survives after the source app closes. Then it gives you a way to search and paste older items.
On X11 this is simple, because any client can observe selections. On Wayland, a background tool needs a privileged extension called a data-control protocol. There are two versions in use: the older wlroots one and a newer standardized one. Support differs by compositor. wlroots-based compositors such as Sway and Hyprland support data control, and KDE Plasma supports the standardized version. GNOME's compositor has historically offered neither, which is why most GNOME clipboard tools are shell extensions that run inside the desktop itself.
The quick way to know which world you are in: run echo $XDG_SESSION_TYPE in a terminal. It prints x11 or wayland.
Common ways to get clipboard history on Linux
Here is how the usual options compare. "Phone sync" means getting copied text onto an Android phone without extra tooling.
| Option | What it is | Session | Phone sync |
|---|---|---|---|
| cliphist + wl-clipboard | Small CLI that stores history from wl-paste and lets you pick with a launcher menu |
Wayland compositors with data control | No |
| CopyQ | Feature-rich, scriptable clipboard manager with tabs | Strong on X11, more caveats on Wayland | No |
| Klipper | Clipboard history built into KDE Plasma | KDE on X11 or Wayland | Through KDE Connect |
| GNOME shell extensions | Clipboard history inside the GNOME panel | GNOME on X11 or Wayland | No |
| InsertKit | GUI clipboard history plus snippets and voice typing on one account | Linux desktop (check the dependency screen on Wayland) | Yes, with the Android app |
On Sway or Hyprland, cliphist is simple and light. On KDE, Klipper is already there. The rest of this post covers the case where you want a GUI and the same history on more than one device.
A GUI clipboard history on Linux that syncs with Android
I use InsertKit for this. It is a desktop app for Windows, macOS and Linux, with an Android app and a Chrome extension that sign in to the same account. On Linux it ships as an AppImage, a .deb and an .rpm. Clipboard history is one of its three main parts, next to text snippets and voice typing.
1. Install, sign in, and check dependencies
After installing, sign in with email and password or Google. Then open Settings → General → Linux Dependencies. It checks for the helper tools the app uses on Linux, such as xdotool, wtype and maim. On Wayland, its tips point to wtype or ydotool. Install whatever it flags, and if you are on Wayland, test in the few apps you use every day before relying on it.
2. Turn on clipboard monitoring
Clipboard capture is controlled by Settings → Snippets → Enable Clipboard Monitoring. With it on, new copies show up on the Clipboard History page automatically, with relative times like "Just now" or "5m ago". From that page you can:
- search your history and see the item count
- click a row to copy it again
- star an item so it stays pinned at the top
- delete single items, or use Clear All (it asks for confirmation)
3. Paste old items with the popup
The part I use most is the quick popup. Press Ctrl+Shift+Z anywhere and a small, draggable window opens with the search box already focused. It has three tabs: Clipboard, Snippets and Favorites. Click an item and it is copied and inserted into the app you were just using. Items are tagged as Email, Url or Text.
Two details worth knowing. The Pin button keeps the window open and on top after inserting, which is handy when you are pasting several items into a form. Without the pin, it hides when you click away, and Esc closes it. If Ctrl+Shift+Z clashes with a shortcut in your editor or terminal, change it in Settings → General → Clipboard Popup Hotkey.
4. Get the same history on your phone
Clipboard history syncs to your account, so text copied on the Linux desktop is available on Android and the other way round. On the phone you have a few ways to reach it:
- the Clipboard tab in the app, with search, favorites and Clear All
- typing
/clipin a text field in most apps, which opens a clipboard history overlay where you tap an item to insert it - the optional InsertKit Keyboard, whose clipboard button shows the latest 15 items along with the platform and source app
The Chrome extension also has a Clipboard History tab and the same Ctrl+Shift+Z shortcut inside the browser.
5. A few habits that keep history useful
- Star what you reuse. Favorites stay on top, so your staging URL or test card number is always one click away.
- Delete sensitive items. If you copy a token or password, remove it from history afterwards, or switch monitoring off before you handle secrets.
- Promote repeat copies to snippets. If you paste the same thing every day, it belongs in a snippet with a trigger like
/staging, not in history.
Clipboard history vs. snippets on Linux
These two features overlap, so it helps to define them:
- Clipboard history is automatic and short-lived. It records what you copied so you can get back to it.
- A snippet is deliberate and permanent. You save text once and insert it by typing a trigger such as
/replyor by picking it from a popup.
Because the Ctrl+Shift+Z popup has a Snippets tab next to the Clipboard tab, I treat them as one place to look. The same app also does voice typing in 100+ languages, which is a nice bonus when I am writing longer issue comments, but clipboard history is the reason I installed it on Linux.
FAQ
How do I see clipboard history on Linux?
Linux does not keep a clipboard history by default. You need a clipboard manager: Klipper on KDE, a shell extension on GNOME, a CLI like cliphist on wlroots compositors, or a cross-platform GUI app. In InsertKit, open the Clipboard History page or press Ctrl+Shift+Z.
Why does copied text disappear when I close an app on Linux?
The app that copied the data owns it and serves it on request. When that app exits, nothing is left to answer the paste. A clipboard manager keeps its own copy, so the content survives.
Does clipboard history work on Wayland?
Yes, but background tools need a data-control protocol, and support differs between compositors. Check $XDG_SESSION_TYPE, follow your tool's Wayland notes, and test in the apps you use most.
What is the difference between PRIMARY and CLIPBOARD on Linux?
PRIMARY holds whatever you last highlighted and is pasted with a middle click. CLIPBOARD holds what you copied with Ctrl+C and is pasted with Ctrl+V. They are separate.
Can I sync clipboard history between Linux and Android?
Yes. KDE users can use KDE Connect. With InsertKit, clipboard history syncs through your account, so copies from the Linux desktop show up in the Android app and through the /clip overlay.
Is it safe to keep passwords in clipboard history?
Treat clipboard history as stored data. Delete secrets after copying them, or turn monitoring off while you work with credentials.
Wrapping up
Clipboard history on Linux is less mysterious once you know that the clipboard is really a hand-off between apps, and that Wayland adds a permission layer on top. Pick the tool that matches your session and desktop. If you want a GUI history that also follows you to your phone, you can try InsertKit's clipboard manager on Linux alongside the tools you already use.
Comments
Join the discussionNo comments yet. Be the first to comment.