Windows build number: Microsoft Windows [Version 10.0.18362.239]
Windows Terminal version (if applicable): Version: 0.3.2171.0
Using bash within Windows terminal.
Copy several text lines and paste them using vi text editor in bash (WSL).
Properly copied lines within the text editor.
A single line is generated with spaces so that it looks like they are different lines.
Just to clarify, this happens when copying lines from within a file in vi to the very same file in vi.
If I copy text lines from outside (let's say, Visual Code) to vi, then this is what happens:
Line1
Line2
Line3
I get a jump line in between every line that I am copying.
So, clipboard keybindings copy/paste came in with PR #1093. There's two copy actions copy and copyTextWithoutNewlines. With mouse copy, holding SHIFT differentiates the two. With keyboard copy, these are two separate keybound options.
Given this information...
copyTextWithoutNewlines (vs copy), does that fix the issue?Let me know below. Thanks!
I tried copying with and without shift by using the mouse: same result.
I did the same thing with the keyboard: same result.
This basically renders useless editing text within the terminal in any Linux system : /
Also, copying several lines from outside the terminal creates a jump line in between every line you copy (and it doesn't matter if you use CRLF or only LF).
Having the same issue you select a couple of lines from Windows Terminal, click the right button, go to notepad, do Ctrl-V and everything ends up on one line with spaces in between.

I'm having a simular issue, but instead of that everything gets pasted into a single line.. when i paste i get after every line, an extra new line...
After i copy from a file/site or notepad etc. into the terminal with the Ubuntu app configured, i get an extra new line between every line.
When i open the Ubuntu app self, i can paste without any extra new lines.
-- same issue as havidarou. and same result with:
I tried copying with and without shift by using the mouse: same result.
I did the same thing with the keyboard: same result.
Hi, I also mentioned that
there are two kind of behaviors:
When copying from a text editor (ex. vscode) spaces between lines will still be generated even if the file is using LF line endings

Copying out of the terminal into a text editor does not add proper newlines as expected

On further review it also appears to add all of the whitespace after the content on each line (more space added the wider the terminal is)

I am seeing this is not just related to bash. Within Powershell 5, powershell core 6 and 7 running in windows terminal, I am getting very inconsistent copy/paste behavior. Extra whitespace, and missing line endings. The whitespace and (missing)line endings are in different places if i resize the terminal window and re-generate the output and copy/paste once again.
Sometimes all lines of output might be pasted as 1 single line, other times, it may paste 6 lines correctly before it begins to start missing line endings, and running lines together
Reproduced by copying any multi-line output from terminal and pasting it into Notepad++ or vscode
Can confirm this behaviour.
If you paste the output of a table ( with \t and \n )

in LibreOffice
all \t and \n are replaced with spaces ???

Also can confirm this behavior. It is very inconsistent with utilities like vi. Pasting into nano via the terminal seems to yield better results than vi. Switched over to a raw Powershell console and vi copy and paste works just fine.
This is the single most frustrating thing about Terminal that makes it mostly unusable. I can live with the little UI glitches, but this is pure frustration.
I am also facing the same issues as reported above in thread. I am primarily using powershell core 6 as primary profile in terminal . This inconsistent behaviour renders windows terminal useless for sysadmins. This is one tool which has huge potential as it gives you option for multiple tabs.
When I copy paste from Windows Notepad three lines with data in towords a Ubuntu in WSL, the copy paste buffer adds an extra carriage return to every line.
look at this printscreen and the hexdump on the file with the copy pasted data and you see the double '0a0a' when it should be a single. (running Windows Terminal (Preview) Version: 0.4.2382.0)
This is still happening in 0.5.
From Windows to bash: double jump lines.
From bash to Windows: there are no jump lines every two lines.
/dup #1091
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!
Most helpful comment
This is the single most frustrating thing about Terminal that makes it mostly unusable. I can live with the little UI glitches, but this is pure frustration.