Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Tracked by #6106
wilbur4321 opened this issue Nov 12, 2021 · 4 comments
Open
Tracked by #6106

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

wilbur4321 opened this issue Nov 12, 2021 · 4 comments
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.
Milestone

Comments

@wilbur4321
Copy link

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.

@wilbur4321 wilbur4321 added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Nov 12, 2021
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Nov 12, 2021
@DHowett
Copy link
Member

DHowett commented Nov 12, 2021

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

@wilbur4321
Copy link
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).

@zadjii-msft zadjii-msft added Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Discussion Something that requires a team discussion before we can proceed Product-Terminal The new Windows Terminal. and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels Nov 15, 2021
@zadjii-msft zadjii-msft removed the Needs-Discussion Something that requires a team discussion before we can proceed label Dec 8, 2021
@sredna
Copy link

sredna commented Dec 9, 2021

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.

@zadjii-msft zadjii-msft added the Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) label Feb 18, 2022
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Feb 18, 2022
@zadjii-msft zadjii-msft added Help Wanted We encourage anyone to jump in on these. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Feb 18, 2022
@zadjii-msft zadjii-msft added this to the Backlog milestone Feb 18, 2022
@pabohoney1
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

5 participants