microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.78k stars 8.34k forks source link

"Remove trailing white-space from rectangular selection" option does not work #12237

Open plastikfan opened 2 years ago

plastikfan commented 2 years ago

Windows Terminal version

1.11.3471.0

Windows build number

10.0.19043.0

Other Software

No response

Steps to reproduce

Ensure that the "Remove trailing white-space from rectangular selection" option is un-checked. Select some text from the terminal window that includes trailing white space, then paste the contents into another application eg notepad. The content pasted in will have its trailing white space trimmed off, contrary to the option setting.

Expected Behavior

When the option is off, trailing white space should not be truncated.

Actual Behavior

Traiing white-space truncation occuring despite the option setting being off.

Just to check that the bug is not simply a negation logic error, I turned it on and repeated the opration, but I found that the content was still be trailing white-space truncated, so it looks like the option is simply ignored.

237dmitry commented 2 years ago

Rectangular Selection (Alt + mouse)?

zadjii-msft commented 2 years ago

gh-12237-no-repro

Hmm. How are you copying? copyOnSelect maybe?

plastikfan commented 2 years ago

Actually, the test case I was talking about only included a single line of text. I know about that setting you showed in the animtaed pic, that is the setting I am reporting on. Perhaps you can retry it with just a single line and you'll find it doesnt work, thanks. And yes I'm using copy on select. Perhaps the rectangular option does not incude single line scenarios, if that is the case, then could we get single line supported also.

plastikfan commented 2 years ago

Ah ha, I've got it. That trailing white space is only presevered if you perform rectangular select which reqquires the use of the alt key, which I didnt realise. When I use alt, the whitespace is presevered. So user error! (could be avoided with a small message (perhaps in brackets) next to "Remove trailing white-space from rectangular selection" to indicate that rectangular selection is activated by the alt key, or whatever is configured, but hey, this is a minor issue so I'm not bothered if you dont think its worth addressing).

Actually, it would be nice if that trailing white space setting would apply to non rectangular selection.

237dmitry commented 2 years ago

https://user-images.githubusercontent.com/78153320/150992844-4bc334c8-1809-4beb-a9eb-56a724e41e94.mp4

plastikfan commented 2 years ago

I assume that is without the alt key? (how do you record that video? I should show what happens on my machine)

237dmitry commented 2 years ago

I assume that is without the alt key?

With or without Alt pressed, the result is the same for single line.

how do you record that video?

Win+Alt+R (Game bar).

zadjii-msft commented 2 years ago

(try screenToGif, it's the bomb)

plastikfan commented 2 years ago

https://user-images.githubusercontent.com/49785914/151064790-39192909-2f7a-467c-b923-eeca328e3825.mp4

zadjii-msft commented 2 years ago

Actually, it would be nice if that trailing white space setting would apply to non-rectangular selection

Team consensus: yea, it probably would. Thanks for the idea!