Rectangular select copies trailing spaces #13302

Closed
opened 2026-01-31 03:39:12 +00:00 by claunia · 8 comments
Owner

Originally created by @randomascii on GitHub (Apr 5, 2021).

Originally assigned to: @Don-Vito on GitHub.

Windows Terminal version (or Windows build number)

1.6.10571.0

Other Software

No response

Steps to reproduce

When doing a rectangular copy of text Windows Terminal copies trailing spaces. If the different lines being copied are of different lengths then this means the clipboard contents end up with varying numbers of spaces. Cleaning this up is a nuisance. Trailing spaces are rarely desirable when pasting text. For instance, if the terminal contained this text:

1: blah blah blah Column 3
2: foo Column 3

then I might want to copy the first two columns of data ("1: blah blah blah" and the subsequent data below or perhaps just the second column of data ("blah blah blah" and the subsequent data below) but I (personally), never want to copy the trailing spaces. I think that this is a change of behavior. I think it is a regression. It is certainly a change from cmd.exe, and not a welcome one.

Expected Behavior

No trailing spaces copied to the clipboard.

Actual Behavior

Trailing spaces copied to the clipboard.

Originally created by @randomascii on GitHub (Apr 5, 2021). Originally assigned to: @Don-Vito on GitHub. ### Windows Terminal version (or Windows build number) 1.6.10571.0 ### Other Software _No response_ ### Steps to reproduce When doing a rectangular copy of text Windows Terminal copies trailing spaces. If the different lines being copied are of different lengths then this means the clipboard contents end up with varying numbers of spaces. Cleaning this up is a nuisance. Trailing spaces are rarely desirable when pasting text. For instance, if the terminal contained this text: 1: blah blah blah Column 3 2: foo Column 3 then I might want to copy the first two columns of data ("1: blah blah blah" and the subsequent data below or perhaps just the second column of data ("blah blah blah" and the subsequent data below) but I (personally), never want to copy the trailing spaces. I think that this is a change of behavior. I think it is a regression. It is certainly a change from cmd.exe, and not a welcome one. ### Expected Behavior No trailing spaces copied to the clipboard. ### Actual Behavior Trailing spaces copied to the clipboard.
Author
Owner

@DHowett commented on GitHub (Apr 5, 2021):

@Don-Vito here’s your callback! ;)

@DHowett commented on GitHub (Apr 5, 2021): @Don-Vito here’s your callback! ;)
Author
Owner

@zadjii-msft commented on GitHub (Apr 6, 2021):

So the original discussion was over here: #6740.

There's not a clear consensus on whether block selection should copy the trailing space or trim them. Both options seem to suck equally.

@zadjii-msft commented on GitHub (Apr 6, 2021): So the original discussion was over here: #6740. There's not a clear consensus on whether block selection should copy the trailing space or trim them. Both options seem to suck equally.
Author
Owner

@randomascii commented on GitHub (Apr 6, 2021):

I'm definitely of the opinion that the old behavior was excellent and the new option sucks greatly.

It sounds like a setting would be worthwhile. There seem to be some developers/workflows that require the full rectangle of characters, but for my purposes I never want it and the presence of those spaces has been making me cranky. I haven't quite gone to the stage where I write a program to trim trailing spaces in the clipboard but that is my mood.

Rather than do that I'd much rather have a setting that trims all trailing spaces, like cmd.exe did.

@randomascii commented on GitHub (Apr 6, 2021): I'm definitely of the opinion that the old behavior was excellent and the new option sucks greatly. It sounds like a setting would be worthwhile. There seem to be some developers/workflows that require the full rectangle of characters, but for my purposes I never want it and the presence of those spaces has been making me cranky. I haven't quite gone to the stage where I write a program to trim trailing spaces in the clipboard but that is my mood. Rather than do that I'd much rather have a setting that trims all trailing spaces, like cmd.exe did.
Author
Owner

@DHowett commented on GitHub (Apr 13, 2021):

Yep, this should be a setting. Thanks 😄

@DHowett commented on GitHub (Apr 13, 2021): Yep, this should be a setting. Thanks :smile:
Author
Owner

@Don-Vito commented on GitHub (Apr 13, 2021):

@DHowett - please assign this to me. What should be the default?

@Don-Vito commented on GitHub (Apr 13, 2021): @DHowett - please assign this to me. What should be the default?
Author
Owner

@DHowett commented on GitHub (Apr 13, 2021):

We're about to drop 1.7 to stable, so we will have ample data on which one people hate more. I am truly uncertain.

@DHowett commented on GitHub (Apr 13, 2021): We're about to drop 1.7 to stable, so we will have **ample** data on which one people hate more. I am truly uncertain.
Author
Owner

@Don-Vito commented on GitHub (Apr 14, 2021):

image

@Don-Vito commented on GitHub (Apr 14, 2021): ![image](https://user-images.githubusercontent.com/4639110/114705336-4b2a8180-9d30-11eb-91ae-eecfb226d6c8.png)
Author
Owner

@ghost commented on GitHub (May 25, 2021):

:tada:This issue was addressed in #9807, which has now been successfully released as Windows Terminal Preview v1.9.1445.0.🎉

Handy links:

@ghost commented on GitHub (May 25, 2021): :tada:This issue was addressed in #9807, which has now been successfully released as `Windows Terminal Preview v1.9.1445.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.9.1445.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#13302