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

When calling native application, carriage return \r in the output should be removed #7248

Open
jiasli opened this issue Jul 29, 2021 · 0 comments
Labels

Comments

@jiasli
Copy link
Member

jiasli commented Jul 29, 2021

Is your feature request related to a problem? Please describe.

When calling a native application, such as powershell.exe, carriage return \r is retained, causing problem down the pipeline.

$ result=$(powershell.exe "Write-Output test")
$ python3 -c "import sys; print(sys.argv)" "$result"
['-c', 'test\r']

The actual output of powershell.exe contains \r\n, but WSL only removes \n, leaving \r in the output.

Describe the solution you'd like

WSL should be smart enough to remove \r.

Additional context

This causes failure when calling Azure CLI installed on Windows (C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd) from WSL (Azure/azure-cli#13573 (comment)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant