The terminal is the one place where the copy and paste shortcut you have used your whole life suddenly does something else. Press Ctrl+C while a command is running and it does not put anything on your clipboard. It stops the command. That is not a bug, and the terminal is not broken. It is a habit from the early days of Unix that every terminal still respects, and once you understand it the rest of terminal copy and paste falls into place quickly.
This guide is the map for developers who live in a shell, covering every platform and the awkward corners (tmux, Vim, SSH) where the rules shift again. If you only need the broader picture across devices, the general guide to copying and pasting covers the basics, but the terminal earns its own page.
Why Ctrl+C means cancel, not copy
Long before Windows borrowed Ctrl+C for copying, terminals used it as a control character. Pressing it sends an interrupt signal, SIGINT, to the program in the foreground, which tells it to stop. That is genuinely useful: it is how you kill a command that is hanging, or break out of a script that is printing forever. Because that meaning came first, terminals could not also make Ctrl+C copy without breaking the cancel behaviour everyone relied on.
The fix the terminal world settled on is simple. Copy and paste moved one key over, to Ctrl+Shift+C and Ctrl+Shift+V. Add Shift and you copy; leave it off and you cancel. That single rule covers most Linux terminals and Windows Terminal. The Mac is the exception, and we will get to why.
Windows Terminal and PowerShell
In Windows Terminal, the modern app that hosts PowerShell, Command Prompt and WSL, the defaults are Ctrl+Shift+C to copy and Ctrl+Shift+V to paste. You can also select text with the mouse and right-click to copy, then right-click again to paste, which is a holdover from the old Command Prompt.
Windows Terminal has a helpful setting that brings back the familiar shortcut without losing cancel. Open Settings, go to Interaction, and turn on the option that lets Ctrl+C copy when text is selected. With it on, Ctrl+C copies your selection if you have one and sends the interrupt signal when you do not. It is the best of both, and worth enabling if your fingers refuse to learn the Shift.
The older Command Prompt console still works the original way: select with the mouse, press Enter or right-click to copy, and right-click to paste. If you are on Windows 11, Windows Terminal is the better home for all of this.
macOS Terminal and iTerm2
The Mac is the easy one. Terminal.app and iTerm2 both use the standard Mac shortcuts: Cmd+C to copy and Cmd+V to paste. There is no clash with the interrupt signal, because the cancel command on a Mac terminal is still Ctrl+C, on the Control key, which sits apart from the Command key that does copy and paste. So the Mac never had to move its copy shortcut at all.
iTerm2 adds a couple of niceties: it can copy text the moment you select it, no shortcut needed, and it keeps its own searchable paste history under Edit, then Paste History.
Linux terminals
Most Linux terminal emulators, including GNOME Terminal, Konsole and the terminal inside many code editors, follow the Ctrl+Shift+C and Ctrl+Shift+V convention. You can also use the mouse, and here Linux has a trick the others do not.
Linux keeps a second clipboard called the primary selection. Any text you highlight is copied to it automatically, with no shortcut, and you paste it with a middle-click. It is completely separate from the normal Ctrl+Shift+C clipboard, so you can effectively hold two things at once: one highlighted, one explicitly copied. It takes a day to get used to and then you miss it everywhere else.
tmux: copy mode
Inside tmux, a terminal multiplexer that splits one window into many panes, copy and paste run through tmux itself rather than the terminal. You enter copy mode with the prefix key (Ctrl+B by default) followed by [. Now you can move around with the arrow keys, start a selection, and copy it into tmux’s own buffer. You paste it back with the prefix key followed by ].
The exact selection keys depend on whether tmux is in vi or emacs mode. In vi mode you press Space to start a selection and Enter to copy it. Many people configure tmux to also push the copied text to the system clipboard so it works with the rest of their apps, which usually means adding a line to ~/.tmux.conf that pipes the selection through a clipboard tool like pbcopy, xclip or wl-copy.
Vim and Neovim
Vim does not copy and paste so much as yank and put. You yank a line with yy, yank a selection made in visual mode with y, and put it back with p. By default this all happens inside Vim’s own registers, not your system clipboard.
To copy to the clipboard your whole machine can see, use the special register: "+y to yank into it and "+p to put from it. This only works if your Vim was built with clipboard support, which you can check by running vim --version and looking for +clipboard. Neovim handles this more smoothly and can be told to use the system clipboard for everything.
The auto-indent trap
Pasting many lines into Vim in insert mode often produces a staircase of runaway indentation, because Vim auto-indents each new line on top of the indentation already in your pasted text. The fix is to run :set paste first, paste, then :set nopaste. Modern terminals and recent Vim versions support bracketed paste, which detects a paste and turns indenting off for you, so this trap is slowly fading.
Copy and paste over SSH
This one confuses people more than it should. When you SSH into a remote server, copy and paste still happen in your local terminal. Selecting text from the remote session copies it to your own clipboard, and pasting sends those characters to the remote shell as if you had typed them. The remote machine has no access to your clipboard at all, which is exactly what you want for security.
One thing to watch: pasting a long or multi-line command over SSH can behave oddly on a slow connection, because the characters arrive slightly apart and the remote shell may act on a half-typed line. Bracketed paste, which most modern shells support, wraps the pasted block so the shell treats it as one chunk. If you paste a command and only part of it runs, that is usually the culprit.
A few habits that save grief
- Add Shift first. When a terminal will not copy, your first guess should be Ctrl+Shift+C rather than Ctrl+C. It is right far more often than not.
- Re-read what you paste. Pasting commands from a web page can carry hidden characters or sneak a trailing newline that runs the command early. Paste into a plain editor first if the source is untrusted.
- Copy file paths cleanly. Getting a full path onto your clipboard without retyping it is its own small skill. We cover the shortcuts in how to copy a file path.
- Know what you are copying. Tokens and IDs you paste around all day, like a JWT or a Base64 string, are easy to mangle with a stray character, so a clean copy matters more than usual.
Frequently asked questions
Why does Ctrl+C not copy in the terminal?
In a terminal, Ctrl+C is an old Unix signal that interrupts the running program. It sends SIGINT, which usually stops or cancels whatever command is going. That meaning predates the Windows-style copy shortcut, so terminals kept Ctrl+C for cancelling and moved copy to a different key combination, normally Ctrl+Shift+C.
How do I paste into Vim without the formatting going wrong?
When you paste into Vim in insert mode, its auto-indent can cascade and stair-step your text. Turn it off first with :set paste, paste your text, then run :set nopaste. If you use a recent Vim or Neovim in a modern terminal, bracketed paste often handles this for you automatically.
Can I copy and paste over an SSH session?
Yes, because copy and paste happen in your local terminal, not on the remote machine. When you select text from a remote session, your local terminal copies it to your local clipboard, and pasting sends the characters as if you typed them. The remote server never touches your clipboard.