-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Docker CLI inserts many unwanted control characters when exec a command inside a container - Windows Server 2019 #38429
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
I've found an old related issue: #26911. |
You can try if that works by passing docker run -it --rm busybox sh -c 'echo $TERM'
xterm
docker run -it --rm -e TERM busybox sh -c 'echo $TERM'
xterm-color |
The container is windows, so it is not expected to understand the TERM environment variable. Nevertheless, I've tried it and get the same result |
There's some older issues around terminal emulation on Windows (see #37002 and issues linked from that). I think those concentrated around this part in the codebase Lines 27 to 88 in ea65a0b
I'm not running Docker on Windows myself, so it's tricky for me to reproduce 😅 , but possibly one of the other people I pinged above may be able to check if there's anything that can be done here |
@javiertuya I highly recommend everyone to use only core version of Windows Server on Docker nodes because of lot of other weaknesses (look example what I have said over year go: #27588 (comment) ) All our servers are so I'm not able to reproduce this one on them but I can see that it happens on Windows 10, version 18.03 + Docker CE 18.09 too. How ever IMO this is more likely bug on PowerShell ISE than on Docker so I would recommend to contact Microsoft about it or use some other editor. |
@olljanat Thank you. I assume that latest docker version changed this behaviour, that can't be handled by a dumb terminal, like powershell ISE (I run docker 18.03.1-ce on linux). I have checked that Visual Studio Code does not have this problem. |
@javiertuya yes that is most probably the case. Can we close this one? |
Hi, anyone knows anything else about this (e.g., anyone contact Microsoft regarding PowerShell ISE)? We tested it, and it failed on some Windows installations but not others. We are piping Docker exec output though WebSocket and our clients reported this exact issue (just to let you know we run Docker on Linux nodes). |
I met this issue too. following is the repro step:
@javiertuya and @thaJeztah do you know how to solve this issue? But if we only output it to terminal instead of redirect the output looks fine. |
Looks like the same issue as #30137. I left a comment there, linking to some possible workarounds; #30137 (comment)
As to
That is expected; if the container's output has control characters / escape sequences, those are handled by the terminal in one case, and in the other case are piped directly to a text-file, so there's nothing in between to handle those control characters. |
Description
When executing a command inside a container (e.g. a ping), the command includes many unwanted control characters at the output:
Steps to reproduce the issue:
Describe the results you received:
From powershell window (note that output form docker version becomes hidden at the console):

From powershell ISE(need two screenshots to include all ouput):


Describe the results you expected:

This is the result from windows server 2016 (running a different version of docker)
Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
Hyper-V virtual machine
The text was updated successfully, but these errors were encountered: