[PR #1197] Double and Triple Click Selection #24521

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

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

State: closed
Merged: Yes


Summary of the Pull Request

Initial double click selection works. So a double click will make a selection within some preset delimiters (' ', '/' '\'). The left side excludes the delimiter. The right side includes it.

Initial triple click selection works. Selects the entire line.

The following known issues will be implemented in separate PRs.
Known Issues:

  • ChunkSelection: move mouse after a double/triple click to select next chunk (section between delimiters)
  • Double Click Settings (#1273 ): configurable delimiters, enable chunk selection, set bounds as inclusive/exclusive

References

#1084 Screenshot Selection: one step closer to this. Now just need to create it and attach it as a configurable option to triple click
#988 Double Click Selection: needs ChunkSelection + Settings before completion
#989 Triple Click Selection: needs ChunkSelection + Settings before completion

PR Checklist

  • Doesn't close issue. Please read above.
  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed
  • Requires documentation to be updated
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

Detailed Description of the Pull Request / Additional comments

TermControl Changes

  • Actually detect Double and Triple Click.
  • TIMESTAMP created to keep track of time delta for double/triple click (couldn't find a XAML way to do this :( )

Terminal Changes

  • Triple Click:
    • pretty straightforward. No delimiter check necessary.
  • Double Click:
    • if double click a delimiter, just select that spot
    • otherwise, expand selection to the left and right (each have their own function)
    • Delimiter check hardcodes space and slashes. This is super temporary because I'll replace it when delimiters are configurable in settings.

Validation Steps Performed

You can actually do most with the header on startup :).

  • Double Click first word in header
  • Double Click any other word in header
  • Triple Click any line
**Original Pull Request:** https://github.com/microsoft/terminal/pull/1197 **State:** closed **Merged:** Yes --- <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request Initial double click selection works. So a double click will make a selection within some preset delimiters (' ', '/' '\\'). The left side excludes the delimiter. The right side includes it. Initial triple click selection works. Selects the entire line. The following known issues will be implemented in separate PRs. Known Issues: * [ ] **ChunkSelection**: move mouse after a double/triple click to select next chunk (section between delimiters) * [x] **Double Click Settings** (#1273 ): configurable delimiters, enable chunk selection, set bounds as inclusive/exclusive <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References #1084 **Screenshot Selection**: one step closer to this. Now just need to create it and attach it as a configurable option to triple click #988 **Double Click** Selection: needs ChunkSelection + Settings before completion #989 **Triple Click Selection**: needs ChunkSelection + Settings before completion <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Doesn't close issue. Please read above. * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [x] Requires documentation to be updated * [x] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments **TermControl Changes** - Actually detect Double and Triple Click. - TIMESTAMP created to keep track of time delta for double/triple click (couldn't find a XAML way to do this :( ) **Terminal Changes** - Triple Click: - pretty straightforward. No delimiter check necessary. - Double Click: - if double click a delimiter, just select that spot - otherwise, expand selection to the left and right (each have their own function) - Delimiter check hardcodes space and slashes. This is super temporary because I'll replace it when delimiters are configurable in settings. <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed You can actually do most with the header on startup :). * [ ] Double Click first word in header * [ ] Double Click any other word in header * [ ] Triple Click any line
claunia added the pull-request label 2026-01-31 09:03: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#24521