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

Mouse selection should begin and end at nearest cell boundary #5099

Open
egmontkob opened this issue Mar 24, 2020 · 7 comments · May be fixed by #18106
Open

Mouse selection should begin and end at nearest cell boundary #5099

egmontkob opened this issue Mar 24, 2020 · 7 comments · May be fixed by #18106
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. In-PR This issue has a related PR Issue-Task It's a feature request, but it doesn't really need a major design. Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Milestone

Comments

@egmontkob
Copy link

Description of the new feature/enhancement

For the intuitive highlighting behavior, and consistency with most other applications; when selecting text with the mouse, the two endpoints should be rounded to the nearest vertical boundary between adjacent characters, and highlight/select whatever is between these two points; rather than necessarily including the character the mouse was clicked on / released at.

Note that this is for single click only. For double click, it's the characters under the click location and the release endpoint that should be expanded.

For more details, rationale etc. see for example kovidgoyal/kitty#945.

@egmontkob egmontkob added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Mar 24, 2020
@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 24, 2020
@DHowett-MSFT DHowett-MSFT added 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. Priority-3 A description (P3) and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels Mar 24, 2020
@DHowett-MSFT DHowett-MSFT added this to the Terminal v1.x milestone Mar 24, 2020
@DHowett-MSFT DHowett-MSFT added 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
Copy link
Contributor

I set about doing this as part of the outstanding selection refactor, and immediately ran into our selection endpoints not being exclusive on the right. @carlos-zamora, do you remember why this differed from a11y?

@carlos-zamora carlos-zamora self-assigned this May 12, 2020
@carlos-zamora
Copy link
Member

I set about doing this as part of the outstanding selection refactor, and immediately ran into our selection endpoints not being exclusive on the right. @carlos-zamora, do you remember why this differed from a11y?

I worked on selection before I worked on accessibility, so that's why haha. This would be a fun refactor I can do. And further combine the accessibility/selection code since they have so much in common.

@vefatica

This comment was marked as off-topic.

@DHowett

This comment was marked as off-topic.

@DHowett

This comment was marked as off-topic.

@vefatica

This comment was marked as off-topic.

@zadjii-msft
Copy link
Member

Notes from #11027

2. Another option would be to provide a configuration option to specify the minimum mouse movement (in pixels) before starting automatic copy selection. The default should be larger than is currently implemented - unless there is some issue with compatibility of UI experience. Or maybe it doesn't need to be configurable, just use a better minimum movement.
Since it is unlikely that anyone wants to select a single character (or even two?), I think a reasonable default might be 1 character width. Actually anything up to 1 character height (to select a full line, moving down) would probably work.

I think this is kinda like #5099? (#5082 + #5096) made this a lot better, but it's still not perfect. I believe the threshold right now is 25% of the min(width, height) of a glyph.

Thanks for the pointers. I suspect that a fix to #5099 would fix my issue as well (looks like my proposal 1). But perhaps my proposal 2 is even easier to fix, as your comment (and #5096) implies:

the threshold right now is 25% of the min(width, height) of a glyph

I would argue that changing 25% to 100% would work as well for real selections, since that allows for moving from the centre of one glyph to the centre of the next. It could be even more, since one rarely needs to select a single character.

On the other hand any increase in the threshold would reduce the number of spurious selections, so a conservative change might be to increase the threshold to 75%.

@zadjii-msft zadjii-msft modified the milestones: 22H2, Backlog Jul 5, 2023
@carlos-zamora carlos-zamora linked a pull request Oct 23, 2024 that will close this issue
1 task
@microsoft-github-policy-service microsoft-github-policy-service bot added the In-PR This issue has a related PR label Oct 23, 2024
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. In-PR This issue has a related PR Issue-Task It's a feature request, but it doesn't really need a major design. Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants