Do Clipboard Managers Work Inside Terminal Apps?
Do Clipboard Managers Work Inside Terminal Apps?
Yes, on macOS they do. Terminal.app, iTerm2, Ghostty, Alacritty, kitty, WezTerm and Warp all copy and paste through the standard system pasteboard. A clipboard manager like Maccy records what you copy there and can paste it back into the terminal. The exceptions are tmux’s internal buffers, text copied on a remote SSH host, and a few security settings, all covered below.
Why do clipboard managers work in terminals at all?
A clipboard manager doesn’t hook into individual apps. It watches the system-wide pasteboard (NSPasteboard.general in macOS terms) and stores each new entry. Anything that writes to that pasteboard is visible to it, whether that’s a browser, a text editor or a terminal emulator.
Terminal emulators on macOS are ordinary Cocoa or GPU-rendered apps. When you select text and press Cmd+C, the emulator writes the selection to the general pasteboard. Cmd+V reads from it. The command-line tools pbcopy and pbpaste do the same from the shell. So a pasteboard-based tool like Maccy App sees terminal copies the same way it sees copies from Safari or Notes.
Compatibility at a glance
| Scenario | Captured by a clipboard manager? | Notes |
|---|---|---|
Select text, Cmd+C in Terminal.app / iTerm2 / Ghostty / Alacritty / kitty / WezTerm / Warp | Yes | Standard system pasteboard write. |
echo hello | pbcopy | Yes | Writes to the general pasteboard. This is the easiest way to test your setup. |
| iTerm2 “copy on selection” | Yes | Every selection becomes a history entry, which can be noisy. Check iTerm2’s selection settings. |
| Copy inside tmux copy-mode (default config) | Usually no | Goes to tmux’s internal buffer unless you bridge it (see below). |
Copy inside Vim/Neovim with "+y | Depends on build | Needs clipboard support (a clipboard-enabled Vim build, or Neovim’s pbcopy provider). Plain y stays inside the editor. |
| Text selected in an SSH session | Only if the terminal supports it | The remote machine has no access to your Mac’s pasteboard. OSC 52 can bridge it. |
| Pasting a history item into the terminal | Yes | Delivered as plain text; rich formatting is ignored. |
How do you test it in 30 seconds?
- Open any terminal and run
echo "clipboard test $(date +%s)" | pbcopy. - Open your clipboard manager’s history. In Maccy, the default shortcut is Shift+Cmd+C.
- The newest entry should be the test string. If so, capture works.
- Select it and paste back into the terminal. If that works too, you’re done.
If capture works but pasting back doesn’t, the issue is almost always permissions. See the next section.
Why won’t my clipboard manager paste into the terminal?
Maccy Mac can copy a history item to the clipboard so that you press Cmd+V yourself, or it can paste for you. The paste-for-you mode works by sending a synthetic Cmd+V to the frontmost app, which requires macOS Accessibility permission.
Check these in order:
- Accessibility permission. Open System Settings → Privacy & Security → Accessibility and confirm Maccy is enabled. If it’s listed but not working, toggle it off and on, or remove and re-add it (this is common after updating macOS or the app).
- Auto-paste setting. In Maccy’s settings, check that automatic pasting is on. Otherwise Maccy only copies the item to the clipboard and you paste manually.
- Secure Keyboard Entry. Terminal.app (Terminal → Secure Keyboard Entry) and iTerm2 (iTerm2 → Secure Keyboard Entry) can enable this protection against keystroke sniffing. It can interfere with some tools that watch or inject keyboard input. Whether it affects your clipboard manager’s hotkey or auto-paste depends on how the tool is implemented. If you hit problems, toggle it off for a test, and fall back to manual Cmd+V if you want to keep it on.
- Keybinding conflicts. Some terminals bind Shift+Cmd+C to their own actions (for example, copy variants in some emulators). If the history window never opens inside one app, change Maccy’s global shortcut.
What about tmux, Vim and SSH?
This is where “it doesn’t work in terminals” complaints usually originate. The clipboard manager is fine; the data never reaches the macOS pasteboard.
tmux
tmux keeps its own paste buffers. Selecting text in copy-mode stores it there, not in the system clipboard. Two common fixes:
- Pipe copies to
pbcopywith a binding such asbind -T copy-mode-vi y send -X copy-pipe-and-cancel "pbcopy". - Enable the
set-clipboardoption so tmux emits OSC 52 sequences to your terminal. Your terminal must also allow clipboard access (see below).
Mouse selection inside tmux is another common source of confusion. With mouse mode on, drag-selection is handled by tmux rather than the terminal. Many terminals let you hold a modifier key (often Option) to bypass tmux and use native selection. The exact key varies by terminal.
Vim and Neovim
Yanking with plain y stays in Vim’s unnamed register. To reach the system clipboard, yank into the + register ("+y) or set clipboard=unnamedplus. This requires a Vim build with clipboard support. Not every Vim build has it, so check with vim --version | grep clipboard and look for +clipboard. Neovim uses pbcopy/pbpaste on macOS automatically when they’re available.
SSH sessions
Text you select in a remote vim or tmux lives on a machine that can’t touch your Mac’s pasteboard. If you select it with your mouse at the terminal level, it’s copied locally like any other on-screen text. If an application on the remote side wants to set your local clipboard, it needs OSC 52, an escape sequence that asks the terminal to do it.
Support varies by terminal and is often disabled by default for security reasons. In iTerm2, the relevant option is under Settings → General → Selection (“Applications in terminal may access clipboard”). Many other modern terminals (kitty, WezTerm, Alacritty, Ghostty) have their own OSC 52 settings; check their documentation. Be aware that allowing remote programs to write to your clipboard is a real trust decision.
Is it safe to use a clipboard manager with a terminal?
Mostly, with two caveats worth taking seriously.
1. Secrets end up in history
Commands like pass -c, op read ... | pbcopy, or copying an API key out of a .env file put sensitive text on the pasteboard, and any history-keeping tool will store it. Well-behaved password managers mark their copies as concealed or transient so clipboard managers skip them (a convention from nspasteboard.org). Maccy Clipboard honors those markers . But plain pbcopy doesn’t set them, so the shell can’t opt out for you.
Practical options:
- Use Maccy’s ignore settings (Settings → Ignore) to skip specific apps, pasteboard types or text patterns via regular expressions. For example, you could ignore anything matching a known token prefix such as
^ghp_for GitHub tokens or^sk-for some API keys. - Ignoring the terminal app entirely is possible but heavy-handed, since it also drops every harmless command you copy. Whether app-level ignore reliably catches
pbcopyoutput from a terminal depends on how the source app is detected. - Delete sensitive entries from history right after use.
- Prefer tools that don’t touch the clipboard at all, like
op runor environment injection, over copying secrets by hand.
Because Maccy is open source and keeps history locally on your Mac, nothing is sent to a server. That limits exposure compared with cloud-synced managers, but local storage still means anything you copied is on disk until cleared.
2. Paste hijacking
A malicious web page can put different text on your clipboard than what it displays, for example a harmless-looking command with a hidden newline and a second command. Pasting multi-line text into a shell can run it immediately. Most modern terminals and shells support bracketed paste mode, which holds multi-line pastes until you press Return. Make sure it’s active (recent zsh enables it by default; in bash it’s controlled by enable-bracketed-paste in readline). A clipboard manager makes it easy to preview an entry before pasting, which is a useful habit for anything copied from the web.
Practical tips for terminal-heavy workflows
- Pin your boilerplate. Frequently reused one-liners (SSH hosts,
dockerflags, kubectl contexts) can be pinned in Maccy so they survive history limits. - Use search. Instead of scrolling through history, type a few characters of the command you need.
- Mind history size. Large log dumps copied from the terminal can bloat history. Lower the history size in settings if that bothers you.
- Multi-line commands. If a pasted command gets mangled, check whether the terminal’s paste-protection prompt or bracketed paste is changing behavior, not the clipboard manager.
Frequently asked questions
Does Maccy work with iTerm2?
Yes. iTerm2 uses the system pasteboard for copy and paste, so Maccy captures its copies and can paste into it. If auto-paste fails, check Maccy’s Accessibility permission and iTerm2’s Secure Keyboard Entry setting.
Why doesn’t my tmux selection show up in clipboard history?
tmux stores copy-mode selections in its own buffer. Bind a copy-mode key to pipe into pbcopy, or enable OSC 52 through set-clipboard and allow it in your terminal.
Do clipboard managers record text copied over SSH?
Only if you copy it at the terminal level (selecting on-screen text) or the remote app uses OSC 52 and your terminal permits it. Otherwise the remote clipboard is invisible to your Mac.
Will a clipboard manager store my passwords from the terminal?
If you copy a secret with pbcopy or by selecting it, it will be stored like any other text. Use ignore rules, delete entries after use, or avoid copying secrets at all.
Can I paste with formatting into a terminal?
No. Terminals work with plain text, so styling is discarded when you paste, regardless of which clipboard manager you use.
The bottom line
Clipboard managers work fine in terminals because terminals use the same macOS pasteboard as everything else. When something seems broken, it’s nearly always one of three things: an app with its own buffer (tmux, Vim), a remote session with no path to your Mac’s clipboard, or a permission such as Accessibility. Sort those out, add an ignore rule for secrets, and your history becomes one of the most useful tools in a command-line workflow.
If you want to try it, Maccy is free and open source. Which clipboard gap bites you most often: tmux, remote sessions, or something else?





