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

Git STDIN not working from PowerShell Integrated Console on Windows PowerShell #4021

Closed
5 of 6 tasks
fred-gagnon opened this issue Jun 13, 2022 · 3 comments · Fixed by PowerShell/PowerShellEditorServices#1836
Assignees

Comments

@fred-gagnon
Copy link

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • If this is a security issue, I have read the security issue reporting guidance.

Summary

With the latest update of the PowerShell extension, piping data to git.exe STDIN fails from the PowerShell Integrated Console configured to use Windows PowerShell (version 5.1.19041.1682). For example:

"protocol=https`nhost=myhost.com`nusername=john`npassword=doe`n`n" | git.exe credential approve
fatal: refusing to work with credential missing protocol field

"protocol=https`nhost=myhost.com`n`n" | git.exe credential fill
fatal: refusing to work with credential missing protocol field

The same commands were working as expected from the PowerShell Integrated Console of extension version 2021.12.0, from a regular Windows PowerShell terminal or from the PowerShell Integrated Console of extension version 2022.5.1 configured to use PowerShell 7.2 rather than Windows Powershell.

PowerShell Version

Name                           Value
----                           -----
PSVersion                      5.1.19041.1682
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.1682
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Visual Studio Code Version

1.68.0
4af164ea3a06f701fe3e89a2bcbb421d2026b68f
x64

Extension Version

ms-vscode.powershell@2022.5.1

Steps to Reproduce

Commands:
"protocol=httpsnhost=myhost.comnusername=johnnpassword=doenn" | git.exe credential approve "protocol=httpsnhost=myhost.comnn" | git.exe credential fill

Both fail with error message:
fatal: refusing to work with credential missing protocol field

Visuals

No response

Logs

No response

@fred-gagnon fred-gagnon added the Issue-Bug A bug to squash. label Jun 13, 2022
@ghost ghost added the Needs: Triage Maintainer attention needed! label Jun 13, 2022
@andyleejordan
Copy link
Member

Thanks, we were able to repro this. @SeeminglyScience tracked down that running [Console]::InputEncoding = [System.Text.UTF8Encoding]::new() "fixes" it, we'll work on a fix into PSES itself.

@fred-gagnon
Copy link
Author

Thanks a lot @andschwa and @SeeminglyScience for the quick fix !

@andyleejordan
Copy link
Member

@fred-gagnon within a few minutes you should be able to update to https://github.com/PowerShell/vscode-powershell/releases/tag/v2022.6.2-preview and this should be resolved!

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 a pull request may close this issue.

2 participants