Skip to content

for wslview: Browser authentication disabled if DISPLAY variable is not set #878

Description

@jolting

wslview is supported
see here:
https://github.com/GitCredentialManager/git-credential-manager/blob/7c4381cb754538367a7d0b33ecf3550ca6b5fa79/src/shared/Core/BrowserUtils.cs#L43

wslview does not require a DISPLAY variable.

However, the posix session manager checks for the DISPLAY variable.
https://github.com/GitCredentialManager/git-credential-manager/blob/7c4381cb754538367a7d0b33ecf3550ca6b5fa79/src/shared/Core/Interop/Posix/PosixSessionManager.cs#L13

Therefore, the browser is disabled.
https://github.com/GitCredentialManager/git-credential-manager/blob/dea7cb1afdab43f3852dd897c58b52ae3b6722a3/src/shared/GitHub/GitHubAuthentication.cs#L70

Possibly broken in this commit.
28f487a

Suggestion:
Bypass the check if wslview is present.

workaround:
Set the display variable.

Which version of GCM are you using?

From a terminal, run git credential-manager-core --version and paste the output.
2.0.785.29792

Which Git host provider are you trying to connect to?

  • Azure DevOps
  • Azure DevOps Server (TFS/on-prem)
  • GitHub
  • GitHub Enterprise
  • Bitbucket
  • Other - please describe

Can you access the remote repository directly in the browser using the remote URL?

  • Yes
  • No, I get a permission error
  • No, for a different reason - please describe

Any private repo will work.


Expected behavior

Browser pops up when authenticating.

Actual behavior

Only show oauth device code login.

Logs

N/A

Metadata

Metadata

Assignees

Labels

auth-issueAn issue authenticating to a hostguiSpecific to graphical user interface controlsplatform:wslSpecific to Windows Subsystem for Linux

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions