Do Clipboard Managers Work Inside Terminal Apps?

Comparte este artículo

Do Clipboard Managers Work Inside Terminal Apps?

Yes. A clipboard manager like Maccy captures anything copied with Cmd+C in Terminal, iTerm2, Ghostty, kitty, Warp and other macOS terminals, and anything piped into pbcopy. It can also paste back into them. The exceptions are a few edge cases: text that only lives in tmux or Vim’s internal buffers, and remote SSH sessions.

Why it works: there is one clipboard, and terminals use it

A clipboard manager doesn’t hook into individual apps. It watches the system pasteboard (NSPasteboard on macOS) and records each change. Maccy App does this by polling the pasteboard’s change count on a short interval, not by intercepting keystrokes . Any app that writes to the pasteboard is visible to it, and terminals are no exception.

So the real question is whether the text you care about actually reaches the system pasteboard. Most of the time it does. When it doesn’t, the cause is almost always the terminal, tmux or Vim, not the clipboard manager.

Copying: what lands in your clipboard history

How you copy Appears in Maccy? Notes
Select text, press Cmd+C Yes In terminals, Cmd+C copies the selection. Ctrl+C is a different thing: it sends an interrupt (SIGINT) to the running process.
Select text with copy-on-select enabled Yes iTerm2 has a «copy to pasteboard on selection» option . With it on, every selection becomes a history entry, which can flood your history.
some-command | pbcopy Yes The standard way to copy command output without touching the mouse.
Copy inside tmux (default mode) Not by default tmux keeps its own paste buffer. Configure it to pipe to pbcopy or use OSC 52 (below).
Yank in Vim without a clipboard register No Yanks go to Vim’s internal registers unless you use the + or * register, or set clipboard=unnamed.
Copy on a remote host over SSH No The remote machine’s clipboard isn’t your Mac’s. Use OSC 52 or copy from the terminal window itself.

Pasting: getting history items back into a terminal

When you pick an item from Maccy Mac‘s popup, it puts that item on the system pasteboard and, if auto-paste is enabled, simulates Cmd+V in the frontmost app. The terminal receives a normal paste. If you don’t want the simulated keystroke, you can pick the item (which loads it onto the clipboard) and press Cmd+V yourself.

Simulating keystrokes requires macOS’s Accessibility permission. If pasting does nothing, check System Settings → Privacy & Security → Accessibility and confirm Maccy Clipboard is enabled. This is the single most common reason «it doesn’t paste in my terminal» reports turn out to be a permissions problem rather than a terminal problem.

A caution about multi-line pastes

Pasting a multi-line snippet into a shell can run each line as soon as it arrives. Modern shells and terminals support bracketed paste mode, which wraps pasted text so the shell treats it as one block you can review before pressing Return. zsh, the default shell on current macOS, supports it. Some terminals also show their own confirmation for multi-line pastes . If you paste from history often, check that your shell and terminal setup behave this way before pasting commands you didn’t write.

The tmux and SSH problem, and the fix

Terminal multiplexers and remote sessions are where «clipboard managers don’t work in terminals» myths come from. Both involve text that never leaves the terminal’s own world.

tmux

tmux’s copy mode stores selections in its own buffer. To get them into the macOS pasteboard, bind your copy key to pipe through pbcopy, for example with copy-pipe-and-cancel "pbcopy" in a copy-mode binding. Older macOS setups needed a reattach-to-user-namespace wrapper; recent versions generally don’t . Alternatively, enable tmux’s set-clipboard option so it emits OSC 52 sequences, and let your terminal handle the rest.

SSH and OSC 52

OSC 52 is a terminal escape sequence that lets a program, even one running on a remote server, ask your local terminal to set your clipboard. Support varies:

Terminal OSC 52 clipboard writes
iTerm2 Supported, but may need to be enabled in settings
kitty Supported, with configurable permissions
Ghostty Supported
Terminal.app Not supported to my knowledge

Once the terminal writes to the macOS pasteboard via OSC 52, your clipboard manager sees it like any other copy.

Vim and Neovim

Neovim detects pbcopy/pbpaste automatically on macOS, so yanking to the + register or setting clipboard=unnamedplus sends text to the system pasteboard. Apple’s bundled Vim may be built without clipboard support. Run vim --version | grep clipboard and look for +clipboard. If you see -clipboard, install Vim from Homebrew or use :w !pbcopy as a workaround.

Security: don’t let your history keep secrets

Terminals are where you handle API keys, tokens and private keys, and anything you copy ends up in your clipboard history. Three habits help:

  1. Use Maccy’s ignore settings. Under Maccy’s settings, the Ignore tab lets you exclude specific apps and pasteboard types . Password managers typically mark their copies as concealed so well-behaved clipboard managers skip them.
  2. Avoid pbcopy for secrets unless you plan to delete the entry afterward.
  3. Clear history deliberately after copying anything sensitive. Maccy stores history locally on your Mac rather than in a cloud service, but local storage still means someone with access to your account could read it.

Troubleshooting checklist

  1. Nothing shows up in history after copying. Confirm the text really reached the system pasteboard: copy it, then paste into TextEdit. If it pastes there but isn’t in history, check Maccy’s ignore list. If it doesn’t paste there, the problem is tmux, Vim or SSH.
  2. History fills with fragments. Copy-on-select is probably on. Turn it off or live with it.
  3. Selecting from Maccy doesn’t paste. Re-check Accessibility permission, then quit and reopen Maccy.
  4. Hotkey conflicts. Some terminal apps and shell setups bind keys that overlap with global shortcuts. Change Maccy’s hotkey in its settings if needed.

Frequently asked questions

Does Maccy work with iTerm2 and Terminal.app?

Yes. Both write to the system pasteboard on Cmd+C and accept pasted input, so Maccy captures and pastes in both.

Why doesn’t my tmux copy appear in clipboard history?

tmux stores copied text in its own buffer by default. Pipe it to pbcopy or enable OSC 52 through set-clipboard.

Can I copy from an SSH session into my Mac’s clipboard history?

Yes, if you copy from the terminal window itself (select and Cmd+C) or use OSC 52 from the remote side. A remote pbcopy doesn’t exist.

Are clipboard managers safe to use with terminal secrets?

They’re safe if you configure them: ignore sensitive apps, clear history after copying secrets, and prefer password managers that mark copies as concealed.

The bottom line

Clipboard managers work with terminals because terminals use the same pasteboard as everything else on your Mac. When something goes missing, trace where the text lived: in tmux, in Vim, or on a remote host. Once you bridge those to the system pasteboard, your history captures everything. Maccy is free and open source, so you can try it in a terminal-heavy workflow at no cost. Which part of your setup is hardest to bridge, tmux, Vim or SSH?

Otros artículos de tu interés

Do Clipboard Managers Work Inside Terminal Apps?
Do Clipboard Managers Work Inside Terminal Apps? Yes. A clipboard manager like Maccy captures anything copied with Cmd+C in Terminal,…