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

Determine proper behavior for single-cell selection; only highlight on click + threshold-drag? #5082

Closed
aybiss opened this issue Mar 23, 2020 · 12 comments · Fixed by #5096
Closed
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Issue-Task It's a feature request, but it doesn't really need a major design. Priority-1 A description (P1) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@aybiss
Copy link

aybiss commented Mar 23, 2020

Environment

Windows 10 v1909
Windows Terminal 0.10.781.0

Steps to reproduce

Click anywhere in the text on an already focused Windows Terminal window.

Expected behavior

Window should do nothing since it is already focused. Text should not be highlighted because there has been no mouse drag.

Actual behavior

The character that's clicked on is now going to overwrite the clipboard if I right click to paste something I've just hunted out in another program or window. I will often fail to notice I've highlighted anything, and even if I do catch myself before muscle memory has completed the action, I cannot "unhighlight" text, and am basically screwed at this point. This means I have to go through with the failed paste operation, if I haven't already, and then go hunt out what I was about to paste again.

This is a pet hate of mine. Please make it so that clicking on the window is not interpreted as marking text, or at least provide an option for this. You would simply have to wait for a mouse drag event, which is what people generally do when they DO want to copy some text, so most people would not even notice this change unless they often copy a single character from a console.

@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 Mar 23, 2020
@egmontkob
Copy link

wait for a mouse drag event

Considering e.g. traditional mouse where clicking almost certainly includes a tiny movement too, it's probably better to introduce some drag threshold (at least that's what VTE does).

@BartXZX
Copy link

BartXZX commented Mar 23, 2020

Would also love it if a single non-dragging click would deselect anything currently selected. That would prevent me from having to press ESC to deselect.

@aybiss
Copy link
Author

aybiss commented Mar 23, 2020

Would also love it if a single non-dragging click would deselect anything currently selected. That would prevent me from having to press ESC to deselect.

Yes that would be an excellent addition too.

@DHowett-MSFT
Copy link
Contributor

Honestly, it's my least favorite part of the traditional console that you can start and finish a selection with a single click.

Putty's threshold is "one cell"; Console's is 0. I'd very much like to get to somewhere between 0.25 and 1 cells as our threshold.

@DHowett-MSFT DHowett-MSFT changed the title Single click without dragging highlights text Determine proper behavior for single-cell selection; only highlight on click + threshold-drag? Mar 24, 2020
@DHowett-MSFT DHowett-MSFT added Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Mar 24, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Mar 24, 2020
@DHowett-MSFT DHowett-MSFT added this to the Terminal v1.0 milestone Mar 24, 2020
@DHowett-MSFT
Copy link
Contributor

I'm triaging this as a bug-task into v1 to force the discussion. 😄

@aybiss
Copy link
Author

aybiss commented Mar 24, 2020

I'm triaging this as a bug-task into v1 to force the discussion. 😄

Thanks, I appreciate it. This is the whole reason I go looking for console alternatives for Windows - so that they'll behave more like a Linux console in this one critical area.

DHowett-MSFT pushed a commit that referenced this issue Mar 24, 2020
This commit rewrites selection handling at the TermControl layer.
Previously, we were keeping track of a number of redundant variables
that were easy to get out of sync.

The new selection model is as follows:

* A single left click will always begin a _pending_ selection operation
* A single left click will always clear a selection (#4477)
* A double left click will always begin a word selection
* A triple left click will always begin a line selection
* A selection will only truly start when the cursor moves a quarter of
  the smallest dimension of a cell (usually its width) in any direction
  _This eliminates the selection of a single cell on one click._
  (#4282, #5082)
* We now keep track of whether the selection has been "copied", or
  "updated" since it was last copied. If an endpoint moves, it is
  updated. For copy-on-select, it is only copied if it's updated.
  (#4740)

Because of this, we can stop tracking the position of the focus-raising
click, and whether it was part of click-drag operation. All clicks can
_become_ part of a click-drag operation if the user drags.

We can also eliminate the special handling of single cell selection at
the TerminalCore layer: since TermControl determines when to begin a
selection, TerminalCore no longer needs to know whether copy on select
is enabled _or_ whether the user has started and then backtracked over a
single cell. This is now implicit in TermControl.

Fixes #4082; Fixes #4477
@egmontkob
Copy link

See also closely related #5099.

@ghost ghost added the In-PR This issue has a related PR label Mar 24, 2020
@cinnamon-msft cinnamon-msft added the Priority-1 A description (P1) label Mar 24, 2020
@DHowett-MSFT
Copy link
Contributor

Marking this v2-scrubbed as Kayla and I discussed scoping it into the milestone. 😄

@DHowett-MSFT
Copy link
Contributor

Sorry, v1-scrubbed

@ghost ghost closed this as completed in #5096 Mar 25, 2020
@ghost ghost removed the In-PR This issue has a related PR label Mar 25, 2020
ghost pushed a commit that referenced this issue Mar 25, 2020
This commit rewrites selection handling at the TermControl layer.
Previously, we were keeping track of a number of redundant variables
that were easy to get out of sync.

The new selection model is as follows:

* A single left click will always begin a _pending_ selection operation
* A single left click will always clear a selection (#4477)
* A double left click will always begin a word selection
* A triple left click will always begin a line selection
* A selection will only truly start when the cursor moves a quarter of
  the smallest dimension of a cell (usually its width) in any direction
  _This eliminates the selection of a single cell on one click._
  (#4282, #5082)
* We now keep track of whether the selection has been "copied", or
  "updated" since it was last copied. If an endpoint moves, it is
  updated. For copy-on-select, it is only copied if it's updated.
  (#4740)

Because of this, we can stop tracking the position of the focus-raising
click, and whether it was part of click-drag operation. All clicks can
_become_ part of a click-drag operation if the user drags.

We can also eliminate the special handling of single cell selection at
the TerminalCore layer: since TermControl determines when to begin a
selection, TerminalCore no longer needs to know whether copy on select
is enabled _or_ whether the user has started and then backtracked over a
single cell. This is now implicit in TermControl.

Fixes #5082; Fixes #4477
@ghost ghost added the Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. label Mar 25, 2020
@ghost
Copy link

ghost commented Apr 22, 2020

🎉This issue was addressed in #5096, which has now been successfully released as Windows Terminal Preview v0.11.1121.0.:tada:

Handy links:

@aaron-oxford
Copy link

I just got the new version and it is now working as desired. Fantastic job guys!

@DHowett-MSFT
Copy link
Contributor

Glad we could help 😄

This issue was closed.
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.) Issue-Bug It either shouldn't be doing this or needs an investigation. Issue-Task It's a feature request, but it doesn't really need a major design. Priority-1 A description (P1) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants