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

Copy and paste from the Windows Terminal doesn't include line breaks #1073

Closed
conioh opened this issue May 30, 2019 · 49 comments · Fixed by #3239

Comments

@conioh
Copy link

commented May 30, 2019

Environment

Windows build number: 10.0.18362.116
Windows Terminal version (if applicable): 71e19cd + changing toolset to v142 and SDK version

Steps to reproduce

  1. Clone, build, package, install and launch Windows Terminal (DevBuild).
  2. Execute docker run --rm -it mcr.microsoft.com/windows/nanoserver:1903
  3. Select multiple lines and right click.
  4. Paste in any text editor. I used VSCode.

Expected behavior

I expected to see the same thing I saw in the terminal - specifically multiple lines.

Actual behavior

One line with lots of space.

Notes

This is different from #65 since it was about conhost and I'm talking about the new terminal, and I didn't have Shift pressed.

@zadjii-msft

This comment has been minimized.

Copy link
Member

commented May 31, 2019

Huh, I'm not seeing this - @carlos-zamora thoughts?

image

@d-bingham

This comment has been minimized.

Copy link
Contributor

commented Jun 1, 2019

@zadjii-msft There's some terminal state change that causes it. Repro steps:

  1. Open up a bash.exe session
  2. ls -l to generate some multiline text
  3. Select and copy it -- works as expected
  4. edit a file with vi
  5. Select and copy text -- now the endlines are missing

image

I've been well aware of this working on the clipboard stuff, but haven't tracked down the bug yet. The bug probably manifests in TextBuffer::GetTextForClipboard, but I haven't had the time to debug it yet.

@DHowett-MSFT

This comment has been minimized.

Copy link
Member

commented Jun 3, 2019

Closing in favor of #1091.

@DHowett-MSFT

This comment has been minimized.

Copy link
Member

commented Jun 4, 2019

It turns out that this is a different issue.

@conioh

This comment has been minimized.

Copy link
Author

commented Jun 5, 2019

I edited the issue to add correct instruction to reproduce.
@d-bingham @zadjii-msft, it happens with docker and not only with WSL.
Also happens if I open the console with hcsdiag console id instead of using docker run.

@ljani

This comment has been minimized.

Copy link

commented Jun 23, 2019

I'm seeing this as well. My shell is Powershell Core 6.2.0 and everything I try to copy has this problem. It seems that the copy functionality copies the whole buffer. Ie, if I'm trying to copy this:

get-content myfile.txt
Hello
World

123456789012345678901234567890

It copies this, where ^ denotes a space and my terminal is 30 chars wide:

get-content^myfile.txt^^^^^^^^
Hello^^^^^^^^^^^^^^^^^^^^^^^^^
World^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
123456789012345678901234567890
@andrp92

This comment has been minimized.

Copy link

commented Jun 25, 2019

I'm having same issue. when entering a copied command like:

apt-get install -y make build-essential checkinstall libssl-dev libbz2-dev libzip-dev
libreadline-gplv2-dev libncursesw5-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libffi-dev
wget curl libldap2-dev zlib1g-dev lib32z1-dev uuid-dev

It only runs the very first line... when using WSL directly, works as expected.

@mikepurvis

This comment has been minimized.

Copy link

commented Jul 11, 2019

I also have this issue when copying text out of an SSH session to a Linux host.

Currently working around it by having this script on my desktop and giving it a double click when I have something I need to paste out of Terminal:

from pyperclip import copy, paste
from re import sub
copy(sub(' {10,}', '\r\n', paste()))
@hanubeki

This comment has been minimized.

Copy link

commented Jul 31, 2019

I think I found an easier reproduce steps.

  1. Open cmd or PowerShell
  2. cls to clear the screen
  3. Run some command that writes output such as dir
  4. Copy output text
  5. Paste to somewhere (e.g. notepad)
  6. Pasted text doesn't include line breaks
@CosmicCatnap

This comment has been minimized.

Copy link

commented Oct 7, 2019

I've been using the Windows Terminal now since it was first pushed, all the way back to when I had to compile each version and this has never worked. Attempting to copy and paste using the shortcuts has issues and the default ctrl+c ctrl+v functionality clearly has problems as well. Combine that with the related issues caused by WSL and I have to question who this is even being built for at this point.

Its nice that you have CI/CD going but clearly its not got great regression testing because I've seen some variant of this bug open/closed/ and then reopened the whole time with no comprehensive solutions. What I don't understand is how every time I've been able to reproduce it easily within minutes so how is this code getting pushed without being tested?
it seems to me that this is all hamstrung to issues inherent in ConPTY which hasn't seen a push in 5 months which smells of project priority issues to me and really should have had a solid year of work on it before this ever saw the light of day on github, because pushing a Terminal that can't even copy and paste at half a year in is paramount to saying "hopefully someone else will fix this for me in the open source community" which is a perfectly fine request of a 1.0 > project with promised features delivered but somewhat distasteful at what appears to be a prototyping phase.

For those of us who are using this to SSH into *nix systems and use vim on our windows box at work which I assume is quite a few of us, or are prototyping in WSL even if just for small things...this piece of software is effectively useless until it can at least pretend to have basic parity with a *nix terminal or even the CMD. Even trying to copy and paste in a CMD session between two files in windows is a dubious proposition at best which makes this an inferior product to the default command prompt bundled with the OS currently.

I don't need tabs, I don't need Acrylic, I don't need some cool new font, in fact the one aesthetic thing that would have been nice was an actual settings menu instead of a profile.json which is another ticket that has been open for months in various states of incomplete.

In summary I need your product to work at a fundamental level where I can actually use it! I don't expect it to be perfect or bug free at any point but its clear you've focused on the wrong things when determining who would want this, what for, and why because currently its just a sad conversation piece about what could have been and talk about how excited and naive we were to think this would turn out well in 6 months.

@postwait

This comment has been minimized.

Copy link

commented Oct 8, 2019

This is a pretty brutal bug. Just a note to help indicate criticality.

@alxtsg

This comment has been minimized.

Copy link

commented Oct 12, 2019

On Windows 10 Pro (version 1903), using Windows Terminal (version 0.5.2762.0) and PowerShell Core (version 6.2.2), I am having the same problem. I connect to multiple Linux-based systems in my daily job, this issue prevents me from copy-and-paste commands/ text effectively.

@gohar94

This comment has been minimized.

Copy link

commented Oct 16, 2019

Is nobody working on this?

@DHowett-MSFT

This comment has been minimized.

Copy link
Member

commented Oct 17, 2019

At this exact moment, we've been focusing on making sure the in-box console continues to work well for the upcoming release of Windows. Sorry about the radio silence! 😃

@mikkushukla

This comment has been minimized.

Copy link

commented Oct 17, 2019

@EdLy3

This comment has been minimized.

Copy link

commented Oct 17, 2019

@pkoscisz

This comment has been minimized.

Copy link

commented Oct 17, 2019

I hope you are kidding, you have major bug that affect the way people interact with the tool and there is no focus on fixing it but you do have time to upgrading it to new windows versions....

@mikkushukla

This comment has been minimized.

Copy link

commented Oct 17, 2019

@alxtsg

This comment has been minimized.

Copy link

commented Oct 17, 2019

I hope you are kidding, you have major bug that affect the way people interact with the tool and there is no focus on fixing it but you do have time to upgrading it to new windows versions....

Well technically this software is still in preview stage and not even stable yet...

@mcornella

This comment has been minimized.

Copy link

commented Oct 17, 2019

@pkoscisz

This comment has been minimized.

Copy link

commented Oct 17, 2019

I hope you are kidding, you have major bug that affect the way people interact with the tool and there is no focus on fixing it but you do have time to upgrading it to new windows versions....

Well technically this software is still in preview stage and not even stable yet...

This is community's feedback which tries to use the tool, i think the major frustration is that nothing is happening on tool side, especially for major bug as this which was reported months ago...

Would be nice if somebody just let us know that you guys are looking into it.

There are other Microsoft terminal

LOL, which ones???

@mcornella

This comment has been minimized.

Copy link

commented Oct 17, 2019

LOL, which ones???

  • The one provided when installing a WSL distro (normally Ubuntu)
  • Powershell console
  • cmd console
@pkoscisz

This comment has been minimized.

Copy link

commented Oct 17, 2019

If you want to stay in ubuntu subsystem, ubuntu one is the only option however as we all know it is basic so we all have been hoping that The Terminal could be the tool.

Please prove us right :)

@awarmfastbear

This comment has been minimized.

Copy link

commented Oct 17, 2019

To those who are impatient and contributing nonsense like 'Copying and pasting works in Putty, it should work here!', do consider that the developers of this are dealing with higher severity issues: crashes, freezing, rendering issues, etc. Those critical issues can rightfully take priority over this. If you want this resolved sooner, you can help debug the issue, apply to their development team, or contribute your own code.

/$0.02

@mikkushukla

This comment has been minimized.

Copy link

commented Oct 17, 2019

@d-bingham

This comment has been minimized.

Copy link
Contributor

commented Oct 17, 2019

Looks like this one will be fixed shortly.

@DHowett-MSFT

This comment has been minimized.

Copy link
Member

commented Oct 17, 2019

To give credit where credit is due, that fix is thanks to @d-bingham. 😸

@nerddtvg

This comment has been minimized.

Copy link

commented Oct 17, 2019

Thank you, @d-bingham, from all of us waiting on the issue.

@pkoscisz

This comment has been minimized.

Copy link

commented Oct 17, 2019

Now, can we get feature to move tabs around by using cursor and if you have many tabs they don't hide behind '+' character please! LOL 💃

@DHowett-MSFT

This comment has been minimized.

Copy link
Member

commented Oct 17, 2019

It's not on-topic for this particular issue, but the tabs are getting a bit of a boost in 0.6. See the tree of issues linked from #3027.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.