Please add a "remove leading and trailing whitespace setting" when copying a single line of text #19809

Open
opened 2026-01-31 06:54:11 +00:00 by claunia · 0 comments
Owner

Originally created by @zadjii-msft on GitHub (May 4, 2023).

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.

Originally created by @zadjii-msft on GitHub (May 4, 2023). 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.
claunia added the Area-SettingsIssue-TaskProduct-TerminalArea-TerminalControl labels 2026-01-31 06:54:11 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19809