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

Fix piping to native commands for Windows PowerShell #1836

Merged
merged 1 commit into from
Jun 22, 2022

Conversation

andyleejordan
Copy link
Member

For an unknown reason, we were explicitly overriding Console.InputEncoding, which led to a bug where input piped to a
native command in Windows PowerShell (where the default encoding is different than our override) would fail. Instead, we just don't override the encodings at all, which lets PSES be closer to the expected experience.

The regression test covers this, though to test the failure I had to move that override outside its guard (as it wasn't being set during tests).

Also fix building on ARM64 in Windows PowerShell, which doesn't have $IsWindows.

Thanks @SeeminglyScience for so quickly figuring out the problem.

Fixes PowerShell/vscode-powershell#4021

For an unknown reason, we were explicitly overriding
`Console.InputEncoding`, which led to a bug where input piped to a
native command in Windows PowerShell (where the default encoding is
different than our override) would fail. Instead, we just don't override
the encodings at all, which lets PSES be closer to the expected
experience.

The regression test covers this, though to test the failure I had to
move that override outside its guard (as it wasn't being set during
tests).

Also fix building on ARM64 in Windows PowerShell, which doesn't have
`$IsWindows`.
@andyleejordan andyleejordan requested a review from a team June 21, 2022 20:47
Copy link
Collaborator

@SeeminglyScience SeeminglyScience left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@andyleejordan andyleejordan merged commit fa6a043 into master Jun 22, 2022
@andyleejordan andyleejordan deleted the andschwa/input-encoding branch June 22, 2022 18:47
@andyleejordan andyleejordan mentioned this pull request Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Git STDIN not working from PowerShell Integrated Console on Windows PowerShell
2 participants