-
Notifications
You must be signed in to change notification settings - Fork 312
Paste limited to 50 chars when run in Docker container on Windows #460
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
Comments
TFS:9535413 |
Is there any progress on this topic? I tried latest PowerShell alpha to validate, but ran into #492 |
I have seen that PowerShell 6 beta is out. Is there any update for this? |
This makes the powershell on |
Please fix, this is really annoying |
Agreed that this is annoying. We're hoping to improve the console API compatibility in |
@daghb If you really need this feature now you can do this with a workaround commented in moby/moby#29646 (comment)
|
As this is likely a containers issue - there is nothing I can do in PSReadLine, so I'm closing this issue. If it turns out that's incorrect - @jstarks will let me know and we'll reopen this issue. |
I just tried the PowerShell 6 RC image on a Windows Server 2016, version 1709 with
and - oh my dear - even here I can reproduce the 50 char paste problem, both from a Mac Docker client as well as directly from the Windows Server machine: Now we have the situation that it does not work for both windowsservercore and nanoserver. So how can we proceed to get this fixed? |
I also can reproduce the same problem in Windows Server Insider 17035 build. |
Using the PowerShell 6.0.0-rc without the PSReadLine module works fine in Insider nanoserver 17035 container. OK, no colors, but pasting a 877 char long command just works fine. So I cannot imagine that this is a problem inside Windows and we have to wait for RS3. :-) |
I can reproduce this problem without PSReadLine, I can even reproduce it in cmd. Paste the following:
Note - 3 lines, not 1. The text
It's possible people don't see this problem w/o PSReadLine because no single line is > 50 characters, but if there was, things probably won't work as expected. |
OK, thanks @lzybkr I can repro this in my environment.
So it's the kind how to read console input in PSReadLine that amplifies the effect. Agreed that something between docker CLI and the cmd in Container stops sending further if the process inside the container reads a little bit, then does something else (cmd executes the first echo) then wants to read more... Interesting that pasting that command in a powershell does not stop at 50 chars but receives some more fragments. My repeatable results look like this:
Removing PSReadLine from microsoft/nanoserver:6.0.0-rc-nanoserver-1709 makes this single line work for me as well in pwsh, but your three line example also stops in the second line. Really weird effect :-) |
My theory - and actually how I came up with my example - is that if you are on cooked input mode, the paste works perfectly for everything up to the first newline. In cooked mode, it makes sense to not simulate keyboard input if possible - in other words, not generate an After Enter (newline), conhost knows it is exiting cooked input mode, and must generate an Normally I suggest using Ctrl+v to paste because it is faster and provides a more reliable experience, but with containers I think that's never an option - the host and container shouldn't be sharing clipboards. At any rate, I think it's obvious there's nothing I can do to fix this in PSReadLine, but if someone finds a workaround, then that'd be great. |
Still no fix for this? I did try this workaround here but that repo does not seem to exist anymore and the second command on it's own doesn't work. |
Pretty sure it works in Windows 2019 or later |
I'm also running into this... any progress? |
@janheindejong - you haven't provided any details like which OS you're hitting the problem. Based on microsoft/terminal#38 it seems like this was fixed - though one comment says it reproduces in 1809. Maybe @jstarks remembers which release has the fix. |
I also have this problem. Windows 10 Pro 1909 with Powershell 7.0.0. Docker for Windows with Docker Engine v19.03.8 running Running Powershell 5.1.14393.1944. |
I also have this problem with the image |
docker run --rm -it microsoft/windowsservercore powershell
Copy 12345678901234567890123456789012345678901234567890hello
Paste that into the powershell window
Expected: entire string to be pasted
Actual: 'hello' is cut off
Removing PSReadline and paste works as expected
The text was updated successfully, but these errors were encountered: