Pasting multiple lines doesn't execute the last line #16656

Closed
opened 2026-01-31 05:18:42 +00:00 by claunia · 4 comments
Owner

Originally created by @berniekratz on GitHub (Feb 5, 2022).

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.

Originally created by @berniekratz on GitHub (Feb 5, 2022). ### 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.
Author
Owner

@berniekratz commented on GitHub (Feb 5, 2022):

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 commented on GitHub (Feb 5, 2022): 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.
Author
Owner

@zadjii-msft commented on GitHub (Feb 6, 2022):

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 commented on GitHub (Feb 6, 2022): 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
Author
Owner

@zadjii-msft commented on GitHub (Feb 8, 2022):

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 commented on GitHub (Feb 8, 2022): 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.
Author
Owner

@ghost commented on GitHub (Sep 13, 2022):

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

Handy links:

@ghost commented on GitHub (Sep 13, 2022): :tada:This issue was addressed in #13698, which has now been successfully released as `Windows Terminal Preview v1.16.252`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.16.252) * [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#16656