How to Paste Into Windows Terminal Safely
To paste into Windows Terminal, press Ctrl+V, Ctrl+Shift+V or Shift+Insert, or right-click when no text is selected. The terminal pastes plain text only, so fonts and colours never come through, but every character does, including line breaks. In most shells a line break runs the line, so a multi-line paste can execute commands immediately. Keep Windows Terminal's multi-line paste warning on, and check commands copied from the web before you confirm.
Paste shortcuts in Windows Terminal
| Action | Default shortcut |
|---|---|
| Paste | Ctrl+V, Ctrl+Shift+V or Shift+Insert |
| Paste with the mouse | Right-click (when nothing is selected) |
| Copy selected text | Ctrl+C, Ctrl+Shift+C, Ctrl+Insert or Enter |
Ctrl+C copies only when text is selected. With no selection, Windows Terminal passes it to the shell as usual, so it still interrupts a running command.
Programs running inside the terminal can need Ctrl+V for themselves. Vim, for example, uses it for block selection. Microsoft's documentation shows how to unbind Ctrl+V in Windows Terminal's settings.json so the program receives it; Ctrl+Shift+V and Shift+Insert still paste.
If right-click opens a menu instead of pasting, the experimental context-menu setting is on. If you turned on copyOnSelect, selecting text copies it immediately and right-click always pastes.
Why a paste can run commands
The terminal sends pasted text to the shell as if you'd typed it. A line break in the pasted text works like pressing Enter, so:
- a copied command that ends with a line break runs as soon as you paste it,
- a multi-line paste can run several commands one after another.
That matters most with commands copied from web pages, chat or documentation, where you can't see a trailing line break. Windows Terminal has two warnings for exactly this:
Setting (in settings.json) | Default | What it does |
|---|---|---|
multiLinePasteWarning | true | Asks before pasting text that contains more than one line |
largePasteWarning | true | Asks before pasting more than 5 KiB of text |
trimPaste | true | Removes trailing whitespace from pasted text |
Leave both warnings on. When the multi-line dialog appears and you expected one line, cancel and check the text. Microsoft's own documentation says the warning is useful if you often copy commands from untrusted websites.
Check a command before you paste it
For anything destructive, or anything copied from a source you don't know:
- Paste it into a text editor such as Notepad or VS Code first.
- Read the whole command, including anything past the edge of the screen.
- Remove trailing blank lines, and replace curly quotes and long dashes with straight quotes and hyphens.
- Copy it again and paste it into the terminal.
- Read it at the prompt before pressing Enter.
Never paste a command you don't understand into an administrator terminal.
See the hidden characters in PowerShell
To see exactly what's on the clipboard before pasting, PowerShell 7 can show it in hexadecimal:
Get-Clipboard -Raw | Format-Hex
Look for 0D 0A (a line break) at the end, E2 80 9C or E2 80 9D (curly double quotes), E2 80 93 (an en dash) and C2 A0 (a non-breaking space). This only reads the clipboard; it doesn't change it.
Characters that break pasted commands
Text copied from documents, chat apps and web pages can contain characters that look right but aren't:
| Source | What to look for |
|---|---|
| Word, Outlook, Google Docs | Curly quotes, en and em dashes in place of - and -- |
| Web pages and blog code blocks | Non-breaking spaces, soft hyphens |
| Excel | Tabs between cells, currency symbols, a trailing line break |
| Slack and Teams | Line breaks added where the message wrapped |
A command such as git commit -m "fix" fails if the quotes are curly, and --force stops being a flag if it became an em dash. To reuse a longer message, skip -m altogether; copying and reusing a git commit message shows git commit -C and keeps the line breaks. How to turn off smart quotes in Word explains where these characters come from, and how to copy a number without the currency symbol covers values copied from Excel.
Pasting into WSL and other shells
In a WSL tab, paste works the same way, because Windows Terminal handles the paste and sends the text to the Linux shell. The multi-line warning applies there too. For anything longer than a few lines, save it as a script file and run the file rather than pasting it. If the script was written in a Windows editor, save it with Unix (LF) line endings; bash can fail on Windows (CRLF) line endings with errors that mention apos;\r'. VS Code shows the line-ending type in its status bar and lets you switch it. WSL clipboard: what crosses into Windows covers copying in the other direction.
Keep secrets out of clipboard history
Commands often contain tokens, passwords or connection strings. If Windows clipboard history is on, every copy also lands in Win+V, and pinned items survive a restart. After copying a secret, open Win+V and delete it, or clear history from Settings > System > Clipboard > Clear clipboard data. Leave Clipboard history across your devices off on machines you use for admin work. Is an API key on the clipboard a security incident? explains what to do if a key leaks.
FAQ
Why does Ctrl+V type ^V in my terminal?
The program or the terminal you're using doesn't bind Ctrl+V to paste. In Windows Terminal, use Ctrl+Shift+V, Shift+Insert or right-click.
How do I turn off the multi-line paste warning?
Set "multiLinePasteWarning": false at the top level of Windows Terminal's settings.json. It's safer to leave it on.
Why does copied text from Windows Terminal paste with colours elsewhere?
That's controlled by the copyFormatting setting, which is off by default. How to copy from Windows Terminal without garbled text covers the copy side.
Related reading
- Windows Terminal: Copy Plain Text Without Formatting
- PowerShell Clipboard Cheat Sheet: Get-Clipboard and Set-Clipboard
- How to Copy a File Path That Works in the Terminal
- How to Redact Tokens From Stack Traces Before Sharing
Sources
- Windows Terminal interaction settings (Microsoft Learn) — copyOnSelect, copyFormatting, trimPaste, largePasteWarning, multiLinePasteWarning, right-click context menu.
- Windows Terminal actions (Microsoft Learn) — default copy and paste key bindings, unbinding Ctrl+V for Vim.
- Get-Clipboard (Microsoft Learn) — reading clipboard text with -Raw.
- Format-Hex (Microsoft Learn) — showing a string's bytes.
- Using the clipboard (Microsoft Support) — clipboard history, clearing data and sync.
Deepender Yadav created Edge Drop and builds and tests it, from the edge-hover shelf to each release. A B.Tech Computer Science Engineering student, Deepender writes the Edge Drop guides, comparisons and developer posts, and checks product details against the app's source code.
GitHub · LinkedInCopy. Stack. Drop.
Transform your clipboard into an interactive edge shelf. Stack, pin, and drag assets into any app with zero friction.
Download for Windows Get from Microsoft Store
How to Install Guide · First 10 Minutes Guide · Drag & Drop Guide · Edge Drop vs Win+V · Support
Free · Lightweight · Privacy First