[PR #9403] Fix selection logic with shift on multi-click #27577

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

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

State: closed
Merged: Yes


PR Checklist

Detailed Description of the Pull Request / Additional comments

The selection with shift is quite broken in 1.6.

It started with #8611 that introduces cell selection on shift+click.
This change resulted in the following defect:
shift+double-click, shift+triple-click select only parts of the word.
The reason for this is that the first shift+click establishes the selection,
while the consequent clicks simply extend it to the relevant boundary
(aka word / line boundary)

However, the logic was broken even before #8611.
For instance, shift+triple-click had exactly the same handicap:
shift+double-click was establishing the selection and the
third click was simply extending it to the line boundary.

This PR addresses the both defects in the following manner:
upon multi-click that starts new selection we establish
a new selection on every consequent click using appropriate mode
(cell/word/line) rather than trying to extend one.
For this purpose we remember the position that started the selection.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/9403 **State:** closed **Merged:** Yes --- ## 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 The selection with shift is quite broken in 1.6. It started with #8611 that introduces cell selection on `shift+click`. This change resulted in the following defect: `shift+double-click`, `shift+triple-click` select only parts of the word. The reason for this is that the first `shift+click` establishes the selection, while the consequent clicks simply extend it to the relevant boundary (aka word / line boundary) However, the logic was broken even before #8611. For instance, `shift+triple-click` had exactly the same handicap: `shift+double-click` was establishing the selection and the third click was simply extending it to the line boundary. This PR addresses the both defects in the following manner: upon multi-click that starts new selection we establish a new selection on every consequent click using appropriate mode (cell/word/line) rather than trying to extend one. For this purpose we remember the position that started the selection.
claunia added the pull-request label 2026-01-31 09:22:47 +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#27577