microsoft / microsoft/terminal
Feature Request: Smart Double-click Selection (regeces?)
@carlos-zamora is already working on this.
Since May 12, 2020.
- Dominant language
- C++
- Stars
- 105k
- Forks
- 9.6k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 29
Description
Description of the new feature/enhancement
The current implementation of mouse double-click in terminal window only selects a word, and triple click selects the entire line.
It is often necessary to select an entire path or other forms of multi-word string (e.g. decimal number, percent value, abbreviated size, email address, ...) when using terminal and it would be nice to have an automatic detection and selection of such multi-word strings.
For example, when using git, typing git status returns the relative paths of the changed files:

If I wanted to copy the path of a specific file (e.g. to diff or open), with the current implementation, I would have to manually drag and select the path of the file. With the requested feature, however, I would only need to double click anywhere on the path of the file and this speeds things up by a lot.
GNOME Terminal already implements the behaviour described here, and it is an extremely useful feature that makes everyday tasks so much simpler and speeds things up significantly.
Proposed technical implementation details (optional)
Define a set of regex rules for detecting and selecting commonly used multi-word strings. Maybe these rules can be customisable in the settings file.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.