Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
berniekratz opened this issue Feb 5, 2022 · 4 comments · Fixed by #13698
Closed

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

berniekratz opened this issue Feb 5, 2022 · 4 comments · Fixed by #13698
Labels
Area-UserInterface Issues pertaining to the user interface of the Console or Terminal good first issue This is a fix that might be easier for someone to do as a first contribution Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@berniekratz
Copy link

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.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Feb 5, 2022
@berniekratz
Copy link
Author

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.

@zadjii-msft
Copy link
Member

zadjii-msft commented 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 zadjii-msft reopened this Feb 6, 2022
@zadjii-msft zadjii-msft added Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. zPreview-Service-Queued-1.13 labels Feb 6, 2022
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Feb 6, 2022
@zadjii-msft zadjii-msft added this to the Terminal v1.14 milestone Feb 6, 2022
@DHowett DHowett added the Priority-1 A description (P1) label Feb 7, 2022
@zadjii-msft zadjii-msft added Priority-3 A description (P3) and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Priority-1 A description (P1) labels Feb 8, 2022
@zadjii-msft
Copy link
Member

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 zadjii-msft added good first issue This is a fix that might be easier for someone to do as a first contribution Help Wanted We encourage anyone to jump in on these. labels Feb 8, 2022
@zadjii-msft zadjii-msft modified the milestones: Terminal v1.14, 22H1 Jun 7, 2022
@zadjii-msft zadjii-msft modified the milestones: 22H1, 22H2 Aug 3, 2022
@ghost ghost added the In-PR This issue has a related PR label Aug 7, 2022
@ghost ghost closed this as completed in #13698 Aug 17, 2022
ghost pushed a commit that referenced this issue Aug 17, 2022
## Summary of the Pull Request
Skips whitespace removal if pasted string is multiline

## PR Checklist
* [x] Closes #12387
* [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA
* [x] Tests added/passed
* [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx
* [ ] Schema updated.
* [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

## Validation Steps Performed
Tests passed
The last command in multiline paste now executes
@ghost ghost added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Aug 17, 2022
@ghost
Copy link

ghost commented Sep 13, 2022

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

Handy links:

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-UserInterface Issues pertaining to the user interface of the Console or Terminal good first issue This is a fix that might be easier for someone to do as a first contribution Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants