microsoft / microsoft/terminal
Please add a "remove leading and trailing whitespace setting" when copying a single line of text
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 105k
- Forks
- 9.6k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 29
Description
promoted from MSFT:43799361
> Frequently I use "git branch" to list out branches, and then triple click on one of them to highlight it, and then right-click to copy it. I then do "git checkout" followed by Ctrl+V to checkout this branch.
>
> When I do this, there's always whitespace at the front of the branch name that was copied.
>
> This is just one concrete example, but this happens all the time. When copying a single line of text it is very rare that the user is trying top copy the entire line of output as-is.
>
> Can you please add a setting that removes leading whitespace when copying. It should apply only to single-line copies.
We could probably add a `"trimWhitespace": "none" | "trailing" | "leading" | "all"` param to `copy`. That seems kinda sensible. The equal of the `paste` property.
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.
Research direction
Start by tracing the terminal's copy entry point and comparing it with the existing paste property. Define how the proposed trimWhitespace options apply only to single-line copies, then verify the behavior for none, trailing, leading, and all whitespace modes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100