[PR #9384] Fix selection logic with shift on multi-click and in mouse mode #27555

Open
opened 2026-01-31 09:22:39 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/9384

State: closed
Merged: No


PR Checklist

Detailed Description of the Pull Request / Additional comments

Currently, if selection is active, all clicks with shift pressed extend it,
i.e., shift+click, shift+double-click, shift+triple-click extend the selection
from anchor start to the current position.

While we can argue the correctness of this UX in general
(hint the terminals I checked usually do something else),
it is fully broken by #8611, that introduced cell selection on shift+click.
Currently, upon shift+double-click:

  • the first click sets the selection
  • the second click simply extends it
    So instead of the word we get only partial selection.

To address this I suggest to change the selection logic to:
extend only on a single-click.
I.e., shift+double-click will select a word rather than
extending an existing selection.

This is how it works in ConEmu.
However MinTTY have even smarter solution
where shift+double-click adds a word to existing selection.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/9384 **State:** closed **Merged:** No --- ## PR Checklist * [x] Closes https://github.com/microsoft/terminal/issues/9382 * [x] CLA signed. * [ ] Tests added/passed * [ ] Documentation updated. * [ ] Schema updated. * [ ] I've discussed this with core contributors already. ## Detailed Description of the Pull Request / Additional comments Currently, if selection is active, all clicks with `shift` pressed extend it, i.e., `shift+click`, `shift+double-click`, `shift+triple-click` extend the selection from anchor start to the current position. While we can argue the correctness of this UX in general (hint the terminals I checked usually do something else), it is fully broken by #8611, that introduced cell selection on `shift+click`. Currently, upon `shift+double-click`: * the first click sets the selection * the second click simply extends it So instead of the word we get only partial selection. To address this I suggest to change the selection logic to: extend only on a `single-click`. I.e., `shift+double-click` will select a word rather than extending an existing selection. This is how it works in ConEmu. However MinTTY have even smarter solution where `shift+double-click` adds a word to existing selection.
claunia added the pull-request label 2026-01-31 09:22:39 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#27555