Repository navigation
Open
Labels
Area-TerminalControlIssues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.)Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.)Help WantedWe encourage anyone to jump in on these.We encourage anyone to jump in on these.In-PRThis issue has a related PRThis issue has a related PRIssue-TaskIt's a feature request, but it doesn't really need a major design.It's a feature request, but it doesn't really need a major design.Product-TerminalThe new Windows Terminal.The new Windows Terminal.
Milestone
Description
Automatic copy to clipboard and clicking in the terminal window combine to overwrite the contents of the clipboard with some whitespace or a single character, far too often/easily.
I find myself, and I imagine others do as well, accidentally selecting something when clicking into the terminal to give it focus, which then wipes out whatever I had in the clipboard that I was about to paste. Window's clipboard history allows retrieval, at least, but it's a few extra steps.
I can think of couple possible solutions off-hand:
- When both
copyOnSelectis enabled, it would be wonderful to have an option to NOT automatically copy whitespace-only and/or single-character selections. - Just automatically, quietly, don't do white-space only or single-character selections within a short period of the terminal window gaining focus. Getting the exact conditions for this could be tricky; something like "within the first 0.5 seconds of gaining focus, and only the first click/drag (or touch), ignore it".
Either of these options (or something similar) should be basically invisible to the user, functioning to protect mistakes with minimal to no impact upon intentional actions, much like palm rejection in apps/systems does.
Reacted by Anders, Mat, Andrew Thompson and AltitudeApps
Metadata
Metadata
Assignees
Labels
Area-TerminalControlIssues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.)Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.)Help WantedWe encourage anyone to jump in on these.We encourage anyone to jump in on these.In-PRThis issue has a related PRThis issue has a related PRIssue-TaskIt's a feature request, but it doesn't really need a major design.It's a feature request, but it doesn't really need a major design.Product-TerminalThe new Windows Terminal.The new Windows Terminal.
Activity
DHowett commentedon Nov 12, 2021
Hmm!
Here's my hot take: what if we just never (without a config option) copy whitespace-only text in
copyOnSelectmode? I wonder how many people would complain. Probably Vince would notice...wilbur4321 commentedon Nov 12, 2021
That would be a huge gain in and of itself! Wouldn't cover the situation where one clicks on an area that contains text to get focus, but that is something we ought to be able to train ourselves to not do, TBH. My only concern would be for people that do copy whitespace only to match indentations.
There exists an option to auto-trim whitespace on rectangular selections (but it does leave new lines). Adding the equivalent for non-rectangular selections and then changing both to not auto-copy whitespace-only selections might be perfect, too!
Still, though, I think the idea of automatic rejection of a selection that occurs right after focus and has a very tiny drag period could be done pretty easy, wouldn't require having (and documenting and testing) another configuration option, and would Just Work (tm).
sredna commentedon Dec 9, 2021
This leaves out one scenario, scrolling by dragging with touch input. It is not nearly as annoying as the focus thing but if you have ever used the terminal on a small screen touch-only device you would know my pain.
pabohoney1 commentedon May 22, 2024
This would be fantastic to implement, I have to re-copy many times a day in my workflow because of empty copies when switching between windows.
erbanku commentedon Oct 10, 2025
Any update? This is very annoying, especially since it scrolls through many pages unintentionally and is hard to stop.
Frischifrisch commentedon May 10, 2026
I can reproduce this regularly on Windows 11 with copyOnSelect enabled.
Scenario:
Why this matters:
This happens during normal terminal use and causes frequent accidental clipboard loss.
Request:
A setting to ignore empty/whitespace-only selections when copyOnSelect is enabled would solve this without changing existing
workflows.
Environment:
I understand this is currently low priority, but I’d really appreciate it if this could be revisited when possible, as it affects
daily usability.
TerminalControl: skip whitespace-only copy-on-select