terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Pasting multiple lines doesn't execute the last line

Open berniekratz opened this issue 3 years ago • 3 comments
trafficstars

Windows Terminal version

1.13.10336.0

Windows build number

10.0.19042.0

Other Software

No response

Steps to reproduce

Copy multiple powershell commands from any text editor. Paste them into the powershell core tab of Windows Terminal. All lines execute except the last line. (even though i've included one or 2 blanks lines after the last line of code - to ensure getting a new line or enter)

Expected Behavior

All pasted lines of code should execute as expected.

Actual Behavior

You must manually press the enter key to get the last command to execute.

berniekratz avatar Feb 05 '22 13:02 berniekratz

Ugh! I'm so sorry. I see there's a setting to remove trailing white-space when pasting. It's either new or got set to on with the recent upgrade. I flipped it to off and things are back to working as expected. I apologize.

berniekratz avatar Feb 05 '22 13:02 berniekratz

ACTUALLY you know what, I'm reopening this. If there's a multiline paste that has trailing whitespace, that we should keep. We should only trim the trailing whitespace if there's a single line paste. I hit this all weekend and it annoyed the bajesus out of me. #11473

zadjii-msft avatar Feb 06 '22 02:02 zadjii-msft

Bah, I tried doing this real quick and dirty like, but turns out the tab handling makes this a lot harder. I can't seem to wrap my head around some simple string handling today 😢

I've got a WIP in https://github.com/microsoft/terminal/compare/dev/migrie/b/12387-trim-spaces. I'm gonna tap out for now, this is a lower priority, serviceable fix.

zadjii-msft avatar Feb 08 '22 18:02 zadjii-msft

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

Handy links:

ghost avatar Sep 13 '22 17:09 ghost