microsoft / microsoft/terminal
Support multiple selections of terminal contents
- Dominant language
- C++
- Stars
- 105k
- Forks
- 9.6k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 29
Description
# Description
Allow creating and copying from multiple selections in the terminal.
# Proposed Implementation Details
The concept of a "selection" is expanded from meaning "a single region of selected text in the terminal buffer" to "one or more regions of selected text in the terminal buffer".
When a (possibly user-defined) trigger or key is active, attempting to select an unselected region of text in the terminal will not dismiss the current selection (if there is one). Rather, the newly-selected region of text will be added as a component of the current selection. If the aforementioned trigger becomes inactive, attempts to selected unselected text will invoke the normal selection behavior (the current selection is dismissed, and a new selection is created).
When a selection with multiple regions is copied to the clipboard, the selected regions' contents are concatenated together, with a (possibly user-defined) delimiter, such as a newline or space.
# Points for Consideration
- Should any additional data regarding multiple selections be added to the clipboard when a multi-region selection is copied?
- What should the default delimiter be when concatenating text from multiple regions? While a newline is the de-facto standard used by editors\* supporting multi-region selections, this may not be appropriate for a terminal application. Users looking to paste the contents of a multi-region selection back into the terminal may want that contents delimited by spaces. An example would be a user copying file names from program output, then pasting them as arguments for a command.
Contributor guide
Research direction
The issue names no files, tests, or entry points to start from. First resolve the open design questions around clipboard metadata and the default delimiter, then trace the terminal selection and copy behavior. Done means users can create multiple selected regions and copy their contents with a defined, configurable delimiter.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100