Skip to content

Add ability to not automatically copy whitespace-only selections #11751

Open

Description

@wilbur4321

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 copyOnSelect is 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.

Activity

  1. added
    Issue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.
    on Nov 12, 2021
  2. ghost added
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Nov 12, 2021
  3. ghost added
    Needs-Tag-FixDoesn't match tag requirements
    on Nov 12, 2021
  4. DHowett commented on Nov 12, 2021

    @DHowett
    Member

    Hmm!

    Here's my hot take: what if we just never (without a config option) copy whitespace-only text in copyOnSelect mode? I wonder how many people would complain. Probably Vince would notice...

  5. wilbur4321 commented on Nov 12, 2021

    @wilbur4321
    Author

    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).

  6. added
    Issue-TaskIt's a feature request, but it doesn't really need a major design.
    Needs-DiscussionSomething that requires a team discussion before we can proceed
    and removed
    Issue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.
    on Nov 15, 2021
  7. sredna commented on Dec 9, 2021

    @sredna

    I think the idea of automatic rejection of a selection that occurs right after focus

    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.

  8. ghost removed
    Needs-Tag-FixDoesn't match tag requirements
    on Feb 18, 2022
  9. added
    Help WantedWe encourage anyone to jump in on these.
    and removed
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Feb 18, 2022
  10. pabohoney1 commented on May 22, 2024

    @pabohoney1

    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.

  11. erbanku commented on Oct 10, 2025

    @erbanku

    Any update? This is very annoying, especially since it scrolls through many pages unintentionally and is hard to stop.

  12. Frischifrisch commented on May 10, 2026

    @Frischifrisch

    I can reproduce this regularly on Windows 11 with copyOnSelect enabled.

    Scenario:

    1. Select useful text (copied as expected)
    2. Click/select empty or whitespace area by accident
    3. Clipboard gets overwritten, and I need Win+V to recover previous entry

    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:

    • Windows Terminal: Version: 1.25.1241.0
    • Windows: Microsoft Windows Version 25H2 (Build 26200.8328)

    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.

  13. added a commit that references this issue on Aug 20, 2026
    d0dbb9f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-TerminalControlIssues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.)Help WantedWe encourage anyone to jump in on these.In-PRThis issue has a related PRIssue-TaskIt's a feature request, but it doesn't really need a major design.Product-TerminalThe new Windows Terminal.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions