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

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/9384
Author: @Don-Vito
Created: 3/5/2021
Status: Closed

Base: mainHead: 9382-no-extend-sel-doubleclick


📝 Commits (2)

  • 7cca19d Fix selection not to extend on multi-click
  • 1aa147f Introduce selection reset on anchor / same position click

📊 Changes

2 files changed (+46 additions, -21 deletions)

View changed files

📝 src/cascadia/TerminalControl/TermControl.cpp (+45 -21)
📝 src/cascadia/TerminalControl/TermControl.h (+1 -0)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/9384 **Author:** [@Don-Vito](https://github.com/Don-Vito) **Created:** 3/5/2021 **Status:** ❌ Closed **Base:** `main` ← **Head:** `9382-no-extend-sel-doubleclick` --- ### 📝 Commits (2) - [`7cca19d`](https://github.com/microsoft/terminal/commit/7cca19d13f77187bce836b510376b52f6ceb19eb) Fix selection not to extend on multi-click - [`1aa147f`](https://github.com/microsoft/terminal/commit/1aa147f181f2c3b20749bbbbe3e6f9edb3925d31) Introduce selection reset on anchor / same position click ### 📊 Changes **2 files changed** (+46 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalControl/TermControl.cpp` (+45 -21) 📝 `src/cascadia/TerminalControl/TermControl.h` (+1 -0) </details> ### 📄 Description ## 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:22:38 +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#27550