Terminal is mistaking word wrapping as actual line breaks when copy/pasting #12613

Closed
opened 2026-01-31 03:20:17 +00:00 by claunia · 6 comments
Owner

Originally created by @nofunatall on GitHub (Feb 16, 2021).

Terminal is mistaking word wrapping as actual line breaks when copy/pasting when using WSL2

Is there some option to disable this?
It's very annoying especially if you have your terminal window on a horizontal monitor screen.

Originally created by @nofunatall on GitHub (Feb 16, 2021). Terminal is mistaking word wrapping as actual line breaks when copy/pasting when using WSL2 Is there some option to disable this? It's very annoying especially if you have your terminal window on a horizontal monitor screen.
claunia added the Resolution-Duplicate label 2026-01-31 03:20:17 +00:00
Author
Owner

@DHowett commented on GitHub (Feb 16, 2021):

This depends greatly on the program that is producing the text. We have seen instances where bash and tmux (for example) detect the width of the terminal and intentionally insert line or word breaks at the appropriate column.

Terminals in general can only detect wrapped text when the application explicitly sends unwrapped lines.

What application are you using in WSL2?

(also, it is very helpful for us if you use the bug reporting template. It has a field for the version of Terminal you’re using and any other software that might impact your issue. It’s harder on us when we have to triage issues that are missing the template!)

@DHowett commented on GitHub (Feb 16, 2021): This depends greatly on the program that is producing the text. We have seen instances where bash and tmux (for example) detect the width of the terminal and intentionally insert line or word breaks at the appropriate column. Terminals in general can only detect wrapped text when the application _explicitly sends unwrapped lines_. What application are you using in WSL2? (also, it is very helpful for us if you use the bug reporting template. It has a field for the version of Terminal you’re using and any other software that might impact your issue. It’s harder on us when we have to triage issues that are missing the template!)
Author
Owner

@DHowett commented on GitHub (Feb 16, 2021):

There is an option to Copy—i believe it’s holding down Shift?—that will delete line breaks even if they were intentional(!). Shift+right click or ctrl+shift+c should do it. I think there’s a config option for the copy key binding as well that will let you strip newlines.

@DHowett commented on GitHub (Feb 16, 2021): There is an option to Copy—i believe it’s holding down Shift?—that will delete line breaks _even if they were intentional(!)_. Shift+right click or ctrl+shift+c should do it. I think there’s a config option for the copy key binding as well that will let you strip newlines.
Author
Owner

@nofunatall commented on GitHub (Feb 16, 2021):

Sometimes not even from any open application just copying something from say bash history or even something from my command line.

@nofunatall commented on GitHub (Feb 16, 2021): Sometimes not even from any open application just copying something from say bash history or even something from my command line.
Author
Owner

@dphadke-msft commented on GitHub (Feb 16, 2021):

Double-click select correctly selects a entire output line regardless of wrapping in Linux terminal apps and PuTTY as well. It's definitely annoying to copy partial line in Terminal (WSL or SSH) or ending up with undue line breaks during copy-paste.
Line wrap != New line.

@dphadke-msft commented on GitHub (Feb 16, 2021): Double-click select correctly selects a entire output line regardless of wrapping in Linux terminal apps and PuTTY as well. It's definitely annoying to copy partial line in Terminal (WSL or SSH) or ending up with undue line breaks during copy-paste. Line wrap != New line.
Author
Owner

@zadjii-msft commented on GitHub (Apr 23, 2021):

(_How the heck did this one escape the triage queue..? _)

Do you have a specific set of repro steps what are reproing this behavior? We've got a tricksy bug over in #6901 where sometimes, conpty does something that ends up breaking lines that should have wrapped, but we don't have a good consistent repro for that one. If you've got a consistent repro, that would be much appreciated in that thread ☺️

/dup #6901

@zadjii-msft commented on GitHub (Apr 23, 2021): (_How the heck did this one escape the triage queue..? _) Do you have a _specific_ set of repro steps what are reproing this behavior? We've got a tricksy bug over in #6901 where sometimes, conpty does something that ends up breaking lines that _should_ have wrapped, but we don't have a good consistent repro for that one. If you've got a consistent repro, that would be much appreciated in that thread ☺️ /dup #6901
Author
Owner

@ghost commented on GitHub (Apr 23, 2021):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Apr 23, 2021): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#12613