microsoft / microsoft/terminal

Add ability to not automatically copy whitespace-only selections

Open
#11,751 6 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-TerminalControl Help Wanted In-PR Issue-Task Product-Terminal
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by locating the copyOnSelect setting and the terminal selection-to-clipboard behavior, then determine how focus-related selections are handled. Done means whitespace-only or single-character accidental selections no longer overwrite the clipboard while intentional selections still copy.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, desktop
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.