Skip to content

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

Closed
PowerShell/PowerShellEditorServices
#1836
@fred-gagnon

Description

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

Metadata

Assignees

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions