How to Copy From Windows Terminal Without Garbled Text
Windows Terminal, by default, copies selected text as both plain text and HTML. The plain text is what most developers want. The HTML is what causes the colourful junk that appears when pasting into a rich-text target (Slack, Word, an email) — the terminal's colour scheme travels with the text, and the target renders it as a row of oddly-coloured letters on a dark background. For developers who paste terminal output into tickets and chat all day, this is a small but persistent annoyance.
This guide is about copying from Windows Terminal cleanly: turning off HTML copy, using block selection for column-aligned text, and pasting as plain text into any target. It is written for developers using Windows Terminal on Windows 10 and 11. For neighbouring topics, see WSL and Windows clipboard: what crosses the boundary, PowerShell here-strings and the clipboard, and clipboard habits that keep secrets off the stack.
Why the default copy is noisy
Windows Terminal's copy behaviour is set in the profile's copyFormatting option. The default in current versions is true for HTML and false for RTF, but the exact default has shifted across versions. When copyFormatting is on, the clipboard receives multiple formats: plain text, HTML, and sometimes RTF. Most paste targets prefer the richest format they understand, which means a rich-text target (Slack, Word, Outlook) will receive the HTML version and render the terminal colours.
The plain text is also on the clipboard, and a paste into a plain-text target (a terminal, a code editor, a plain-text file) will receive it correctly. The problem is specifically rich-text targets picking up the HTML.
Disabling HTML copy
The fix is to turn off copyFormatting in Windows Terminal's settings. Two ways:
Via the Settings UI
- Open Windows Terminal.
- Open Settings (
Ctrl+,or the dropdown menu → Settings). - Select the profile (e.g. "Ubuntu" or "PowerShell") on the left.
- Under "Appearance" or "Advanced" (varies by version), find "Copy formatting" and set it to "Plain text only".
- Save.
Via the JSON settings
- Open Settings (
Ctrl+,). - Click "Open JSON file" in the bottom-left (or press
Ctrl+Shift+,). - In the profile's section, add or modify:
"copyFormatting": "none"
- Save. Windows Terminal reloads the settings automatically.
Setting copyFormatting to "none" (or false in older versions) disables HTML and RTF copy. The clipboard receives only plain text, and every paste target renders the same way.
Block selection for column-aligned text
The default selection in Windows Terminal is line-based: select from a starting character to an ending character, including everything in between. For column-aligned output — a table, an indented log, a code block with leading whitespace — line-based selection includes the wrapping and the prompt, which is usually not what the developer wants.
Windows Terminal supports block selection (also called rectangular selection) via Alt+drag. Hold Alt, click and drag from one corner to the opposite corner, and the selection is a rectangle of text. The copied content is the rectangle, without the surrounding lines.
Block selection is useful for:
- Copying a column from a table output by a CLI tool (e.g.
kubectl get pods,git branch -v,ls -l). - Copying an indented code block without the leading prompt characters.
- Copying a vertical slice of a log to extract just the timestamps or just the error messages.
For wider column-aligned copies, the Alt+Shift+arrow keyboard selection also works: hold Alt+Shift and use the arrow keys to expand the rectangle.
Stripping the prompt
When copying terminal output that includes the shell prompt, the prompt is part of the copied text. Pasting that into a chat or ticket means the reader sees user@host:~/project$ command rather than just the command output. For clean pastes, strip the prompt before copying.
Options:
- Select around the prompt. Click and drag from the end of the prompt to the start of the next prompt, skipping the prompt itself. Works but fiddly.
- Use block selection. If the prompt is in a predictable column, block-select the output to the right of the prompt column.
- Clear the terminal first. Run
clear(bash) orClear-Host(PowerShell) to wipe the scrollback, run the command, then copy the clean output. Loses history but produces a clean copy. - Pipe to
clip.exe(Windows) orpbcopy(WSL with the wrapper from WSL and Windows clipboard: what crosses the boundary).command | clip.exeputs the command's output directly on the clipboard, no selection needed.
The clip.exe pattern is the cleanest for known commands. kubectl get pods | clip.exe puts the table on the clipboard without the prompt or the surrounding terminal chrome.
Pasting as plain text
When pasting into a rich-text target, even with copyFormatting disabled, the target may apply its own formatting (font, colour, indentation) to the pasted text. To paste as plain text regardless of the target's defaults:
- Slack —
Ctrl+Shift+Vpastes as plain text. - Chrome / Edge —
Ctrl+Shift+Vpastes as plain text into most web text areas. - Word —
Ctrl+Shift+Vopens the "Paste Special" dialog; select "Unformatted Text". - Outlook —
Ctrl+Shift+Vpastes as plain text. - VS Code —
Ctrl+Shift+Vopens the paste-as menu (in newer versions); plain text is the default if no formatting is on the clipboard.
The Ctrl+Shift+V shortcut is broadly consistent across Windows apps for "paste as plain text", though the exact behaviour varies. For apps that do not honour it (some Electron apps, some Java apps), pasting into a plain-text editor first (Notepad) and re-copying strips all formatting.
When you want the formatting
There are cases where the terminal colours are useful to preserve — for example, when pasting into a documentation generator that renders ANSI escape codes, or when sharing a screenshot-style paste in a Slack channel that supports code block formatting. In those cases:
- Re-enable
copyFormattingfor that profile, or use the per-copy override (Ctrl+Shift+Cin some versions copies with formatting regardless of the setting). - Paste into a target that supports ANSI codes — Slack's code blocks (
`) render ANSI codes when the snippet is uploaded as a file, not pasted as text. - Use a screenshot for cases where the visual layout matters more than the text content.
These cases are rare. For most developer work, plain text is the right default.
Common paste failures
A few specific paste failures are worth knowing:
- Pasting a multi-line command into a bash prompt. If the lines contain
\r\nline endings (from a Windows copy), bash may execute each line separately rather than as one command. The fix is to useCtrl+Shift+V(paste as one block) or to convert line endings before pasting. - Pasting into
vimin a terminal. Vim's paste mode (:set paste) disables auto-indent and other formatting that mangles pasted text. Turn it on before pasting, off after. - Pasting into
python -iornode -e. Multi-line pastes into interactive REPLs often break because the REPL reads each line as a separate input. Use a heredoc (python << EOF ... EOF) or write to a file and run the file.
For more on the PowerShell-specific here-string pattern, see PowerShell here-strings and the clipboard. For paste targets outside the terminal, pasting into terminals: always plain text is the companion habit.
A practical configuration
For most developers, the configuration that works:
- Disable
copyFormattingglobally or per-profile. Plain text by default. - Learn
Alt+dragfor block selection. Use it for column-aligned output. - Learn
Ctrl+Shift+Vfor paste-as-plain-text in rich-text targets. - Use
command | clip.exefor clean copies of command output. - Strip the prompt by selecting around it or by clearing the terminal first.
These five habits take a day to internalise and eliminate the garbled-paste problem for almost every case.
Terminal-specific copy shortcuts
Windows Terminal's default keyboard shortcuts for copy and paste are Ctrl+Shift+C and Ctrl+Shift+V, deliberately distinct from the Windows-standard Ctrl+C and Ctrl+V to avoid conflict with Ctrl+C (which sends SIGINT in most shells). Some developers remap these to Ctrl+C and Ctrl+V for muscle-memory consistency with other apps, at the cost of losing the easy SIGINT. The remapping is a personal preference; the default is safer for developers who use SIGINT frequently.
Other useful copy-related shortcuts:
Ctrl+A— select all text in the buffer. Useful for copying an entire scrollback to a file.Ctrl+Shift+Home/Ctrl+Shift+End— extend selection to the start or end of the buffer.Ctrl+Insert/Shift+Insert— the older Windows copy/paste shortcuts, still honoured by Windows Terminal. Useful whenCtrl+Shift+Cis intercepted by another tool.- Right-click — in Windows Terminal, right-click pastes the clipboard contents (if no selection) or copies the selection (if there is one). This behaviour is configurable; some developers turn it off to avoid accidental pastes.
These shortcuts are documented in Windows Terminal's settings under "Actions". Reviewing them once and learning the three or four that match a given workflow saves time.
When to use a screenshot instead
For some paste targets, a screenshot of the terminal output is more useful than the text itself. A screenshot preserves the colour scheme, the layout, and the visual context — useful when filing a bug report where the visual presentation matters (e.g. a UI rendering bug, a colour-coded log output). Screenshots are also immune to the formatting and truncation issues that affect text pastes.
The downside of a screenshot is that the text is not searchable and cannot be re-copied. For most developer workflows — pasting error messages, command output, code snippets — text is the right medium. For UI bugs and visual presentations, a screenshot is the right medium. Pick the medium that matches what the reader needs to do with the content.
Related reading
- PowerShell Here-Strings and the Clipboard
- JSON Payloads: Keep Them as Files, Not Clips
- Best Clipboard Habits for Developers in 2026
- Clipboard Tools on Multi-Monitor Windows Setups
Sources
- Microsoft Learn — Windows Terminal documentation — official Windows Terminal documentation covering settings, profiles, and the
copyFormattingoption - Microsoft Learn — Windows Terminal JSON profile settings — official reference for the JSON profile settings, including
copyFormattingand selection behaviour - Microsoft Learn — clip command — official documentation for
clip.exe, used to pipe command output to the clipboard - Windows Terminal GitHub — Issues and discussions — the open-source repository for Windows Terminal, where copy-formatting behaviour is discussed and tracked
- Slack — Format messages with code blocks — Slack's guidance on code blocks and paste formatting, including the
Ctrl+Shift+Vplain-text paste shortcut
Deepender Yadav is a B.Tech Computer Science Engineering student and software developer interested in building practical software and open-source projects.
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