-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Pasted text includes CRLF pairs where unneeded #1091
Comments
This is now the master issue for line feeds on copy/paste. We need a holistic solution that addresses this ("...includes too many line breaks") and #1073 ("... doesn't include line breaks"). 😁 |
@DHowett-MSFT @d-bingham The description talks about WSL, but my issue (#1073) happened with no WSL involvement. It's indeed tricky to reproduce (which I noticed after seeing your comments) but happened without WSL. |
Indeed. This is more likely related to the console's output mode and what was written to the screen and how it was written instead of any particular tool. |
Maybe I'm missing something - I admit that I don't know how all this GitHub thing works - but it says above that: It makes it sound as if once #1094 is approved and merged this issue will be close automatically, and if I understand correctly you agree that it shouldn't. |
Oh, I see: I got my copies and pastes mixed up. |
For Unix/WSL I believe this should be CRLFs to CRs, and not CRLFs to LFs |
Sorry to bother, but is there at least any workaround (makes it pretty unusable)? I mean in emacs I can redefine pasting function, is there some piping commands reading clipboard I can run from bash to read clipboard with no doubled newlines? |
Ok, I'm not sure if thats the place for it to live, but if anyone struggles with it, here's mine workaround using autohotkey program:
Now, by pressing LCtrl + t I get normal clipboard output with no doubled newlines, if anyone struggles - workaround for now. |
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References #1091 #1094 #2390 #3314 <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #1091 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Requires documentation to be updated * [x] 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 <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments Combination of the PRs #1094, #2390, and #3314, especially as discussed in #3314. In short, this changes line endings from Windows-space \r\n to the more universal \r. <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed Copied and pasted text into the terminal without the patch, line endings were doubled. With the patch, line endings weren't doubled. -------------------- * Replacing \r\n line endings with \r line endings * Fixing Formatting
Thank you everyone! Glad to see this finally fixed, it was one of the major pain points while using the new Terminal |
Is this fix available in any released preview version of Terminal? It doesn't appear to be in v0.6.2951.0. |
@erwa not yet. v0.6.2951.0 was the "1910" Terminal milestone, and this is fixed for the "1911" milestone. It will be in the next released preview version of the Terminal, sometime later in November. |
Gotcha, thanks for the ETA, Mike. I eagerly await the next preview release :). |
🎉This issue was addressed in #3449, which has now been successfully released as Handy links: |
YESS!! Finally!! I can confirm this issue is fixed in the new preview release. Thank you for fixing this! |
One thing I prefer about using the Windows Terminal over the Ubuntu Shell is Windows Terminal has tabs support built-in whereas the Ubuntu Shell does not (I end up using tmux instead). |
To be honest I am running into these issues since update to 0.10.781.0. |
Commenting on a closed issue is not a very good way to get help. Would you mind putting together a more robust bug report so that we can try to reproduce it? |
@DHowett-MSFT Yep, will do. Although, I am having a hard time to navigate around all the issues which somehow look to be related to copy-pasting from (1) terminal to terminal (2) from an application to terminal. Maybe someone from the team should look over it and aggregate everything into one? |
I have the same problem @paul-michalik encounters I am also an the version 0.10.781.0 |
You're hitting #5113, which is fixed pending release. |
Multiline text pasted from the clipboard includes CRLF pairs in all cases; this is inappropriate for "Unix-space" sessions, such as WSL.
Environment
Steps to reproduce
Select multiline text in Terminal.
Copy it (via right-click, ostensibly)
Paste it (again via right-click)
Expected behavior
When pasting into a Unix-space session -- such as WSL -- pasted text should have a reasonable set of line-ending characters.
Actual behavior
Line endings are "doubled" on text paste to Unix-space sessions.
The text was updated successfully, but these errors were encountered: