-
Notifications
You must be signed in to change notification settings - Fork 55
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
Windows: stderr output leaks into stdout #83
Comments
BTW I am using |
We just noticed in containerd/nerdctl#3629 that this is breaking buildctl's ability to output built images to stdout, e.g., piping to The core problem is that I haven't checked the commits to see if there was a reason it was done this way, but maybe it's as simple as making the Windows version work more like the Linux version by holding and using the |
Looks like 7a61819 did that, but based on a previously conditional "if windows"; commit before that apparently reverted a change that (from a quick read) did preserve what was passed; #29 (related to containerd/containerd#2560 ?) |
I found that on Windows, if a console is generated from stderr, output sent towards the console will go into stdout
with extra warning like.failed to get console mode for stdout: The handle is invalid.
(resovled in 7b7885a)Verified this with a simple test program in here which simply outputs three messages
In Powershell, the output is like:
The
via stderr console
log goes wrongly into the variable$a
(which should only contain the command's success output stream and stdout output).As a comparison, below is the behavior of the test program on Zsh(Ubuntu 20.04)
We can see tht the
via stderr console
doesn't goes into the stdout output as expected.The text was updated successfully, but these errors were encountered: