Clipboard management

Remembering two things at once

2018-08-08 — 2025-08-21

Wherein clipboard managers are surveyed and the practice of syncing clips — including OSC52 terminal escapes to push remote text into a local clipboard — is described, and attendant security risks are noted.

compsci
computers are awful
faster pussycat
Figure 1: A good clipboard manager makes copying easier

1 Clipboard history

Many of these raise security concerns, i.e. do we want a password that we copied from our password manager to be lying around in our clipboard manager forever?

1.1 Zazu

App launcher Zazu (Mac, Windows, Linux) offers a clipboard manager.

1.2 Flycut/Jumpcut

I have a notion that Jumpcut and Flycut grew out of the same codebase? If so, the divorce was messy because they now ignore each other at parties. Flycut was forked from Jumpcut while Jumpcut was inactive for a couple of years, I think? Both now seem to have added App Store support. Free and open source.

1.3 Maccy

Maccy is a free (technically: donationware), open-source Mac clipboard manager. It can be configured to respect password privacy on the clipboard and looks rather nice. It seems to be friends with both Flycut and Jumpcut, which could be awkward at parties.

1.4 Clipy

Clipy doesn’t have English documentation that I can see, so I won’t itemize its advantages right now. It is a free, open-source macOS clipboard manager.

1.5 CopyQ

Clipboard manager CopyQ (Mac/Windows/Linux) offers syncing of clips via file on disk. If we have secure sync, this might be attractive to us. That would even provide a (circuitous) cross-platform means of copying clipboard contents from desktop to smartphones.

We can write new commands using our choice of scripting language. It has an internal scripting API (although that uses an elderly JavaScript version). It supports encrypted items, which might be handy if we had the discipline to remember to use it for copy-pasting passwords.

In CopyQ there seems to be no way of marking passwords on the clipboard as secret unless they come from certain password apps; that’s tedious and presumes we aren’t using a command-line password manager or a browser plugin.

Lazy install:

brew install --cask copyq

1.6 Cutbox

Cutbox (Mac) offers JavaScript clipboard processing. Very zeitgeisty.

1.7 Paste.app

Paste is the app I used for ages. It’s a subscription service, AUD16.50/yr.

1.8 Yoink

Yoink (Mac/iOS) also integrates with drag-and-drop, which is a killer USP.

1.9 Klipper

The KDE one (Mac/Windows/Android, Linux). Note it relies on Google Cloud Messaging for sync which is deprecated; possibly an indication of being unmaintained. It functions fine as a local clipboard, though.

1.10 Clipman

A sometimes-recommended Windows one I haven’t used is clipman.

1.11 Built-in Windows clipboard manager

Windows 10 includes clipboard history by default.

2 Clipboard as file

Not mainstream, but apparently a thing for hobbyists and Cygwin?

3 Command-line

Mentioned elsewhere but collated here: tips for using shell scripting to interact with the clipboard!

3.1 macOS

cat foo | pbcopy
pbpaste > whatever.txt

3.2 X11

Easy… and yet! Needlessly, it doesn’t do what I expect!

The command is xclip, which by default copies data into pneumatic pipes, or somewhere else I don’t know how to retrieve it from, because I’m not 7ee+ hack0rz. There’s some whole parallel copy-paste system that I don’t care about, that isn’t in my muscle memory and that I will therefore never use. Something about my “middle mouse button”, which I only have on relatively few of the mismatched menagerie of mice my computers use.

Anyway, the argument I need to actually use to work with the clipboard content for normal apps that follow the non-X11 copy-paste conventions, and for laptops without a “middle button”, is -selection clipboard. See stackexchange.

cat foo.txt | xclip -selection clipboard
xclip --out -selection clipboard > file.txt

I can never remember it halfway through a pipe when I need it, so I put it in my bash profile and pretend I’m on macOS.

alias pbcopy "xclip -selection clipboard"
alias pbpaste "xclip --out -selection clipboard"

This is easier in principle with fish, which automagically copies using a decent default command for our particular OS via

cat foo.txt | fish_clipboard_copy

4 Networked clipboards

Do we want to copy and paste between devices? If we’re only using Apple devices this is easy via “Hand off”. Microsoft offers a Windows sync service. Cross-platform, though… hmm. A couple of the above options, e.g. CopyQ, offer sync. So do Paste and Copied. Beware of the obvious security risks of pumping passwords to all our computers. In practice, I don’t need this often enough to bother, and I use a secure note-taking app to send notes between my computers explicitly rather than using magical note syncing. However, I do use the OSC52 trick.

4.1 Any remote terminal via OSC52

Yes—use OSC 52 (terminal clipboard escape codes). VS Code’s integrated terminal (on macOS) understands OSC 52, so if the remote shell emits the escape, the text lands in our local macOS clipboard.

Add this function to the remote Linux host (e.g., in ~/.bashrc or ~/.zshrc):

# copy stdin to the *local* clipboard via OSC 52
pbcopy() {
  # GNU base64 (Linux) wraps lines by default; strip newlines to keep OSC payload intact.
  local data
  data=$(base64 | tr -d '\r\n')
  printf '\e]52;c;%s\a' "$data"
}

Usage examples (on the remote):

echo "hello world" | pbcopy                 # copies "hello world"
cat results.txt | pbcopy                    # copies file contents
kubectl logs my-pod | pbcopy                # copies command output

Some extra config is required for tmux.

4.2 Clipbrd

Clipbrd Chrome browser ↔︎ Android app clipboard app.

4.3 Share clipboard

Share clipboard runs a custom local network service to share across desktop and mobile platforms. It’s not clear to me how secure this is, since the docs don’t mention encryption. Are we cool with anyone on our local network reading any data we send? At least it’s probably not transmitting our passwords across the whole internet.

Ever wondering if it’s possible to copy text from an iOS device and paste it to another iOS device? Or even copy text back and forth between your iOS device and your PC/Mac/Linux computer? Yes, you got the answer, Share Clipboard makes all these possible!

There’s a JS/node version for Windows and Linux, plus apps for macOS and iOS.

4.4 pastebin

pastebin, the public sharing service, also has a command-line. Handy if what we’re copying isn’t private.

4.5 Altcopy

altcopy

Copy text from your PC to your Smart device’s clipboard, and Paste text from your device’s clipboard to your PC, instantly! All you need is the PC application, and the Android application on your device. No sign-in required!

Text can be copied over any network. As long as your PC and Smart device both have internet connections, you’re good to go. Alt-C uses Google Cloud Messaging with SSL connections to copy the text.