GCM on Windows incompatible with (tab-ified) Windows Terminal
Version
2.6.1+786ab03440ddc82e807a97c0e540f5247e44cec6
Operating system
Windows
OS version or distribution
Windows 11 24H2 Build 26100.6899
Git hosting provider(s)
Azure DevOps
Other hosting provider
No response
(Azure DevOps only) What format is your remote URL?
https://{org}.visualstudio.com
Can you access the remote repository directly in the browser?
Yes, I can access the repository
Expected behavior
(Evidence of configuration correctness) Attempting to invoke initial single-sign-on authentication through GCM by typing
git fetch
successfully opens the GCM window that prompts me which login identity to use for the authentication if I invoke it at a non-Windows-Terminal such as Git Bash Shell or Cygwin Bash Shell.
Actual behavior
(Evidence of bug) However, when I invoke the same command on a stale or un-authenticated repo from a Windows (tab-ified) terminal window such as Git CMD or the plain CMD terminal window then the response is:
C:\myrepo>git fetch
fatal: Error creating window handle.
Username for 'https://myorg.visualstudio.com/myproject/_git/myrepo':
but I do not wish to use password authentication.
Once I have successfully authenticated once with the repo, I can use any terminal window I like to continue interacting with it. But once that cached authentication needs to be renewed I have to remember to go back to a non-Windows-terminal (non-tab-ified terminal window) in order to refresh my authentication.
Note that failure occurs in Powershell, CMD, and Anaconda CMD, which all use the tab-ified Windows Terminal. It also fails with a git clone interaction with the remote repo, which may be more convenient for testing.
Logs
C:\myrepo>git credential-manager diagnose
Running diagnostics...
[ OK ] Environment
[ OK ] File system
[ OK ] Networking
[ OK ] Git
[ OK ] Credential storage
[ OK ] Microsoft authentication (AAD/MSA)
[ OK ] GitHub API
Diagnostic summary: 7 passed, 0 skipped, 0 failed.
Log files:
C:\myrepo\gcm-diagnose_gitcmd.log
Also ran diagnostics using Git Bash with same terminal output and the failed authorization log, attached log files separately.
I also found this bug report that includes some discussion around programming around Windows Terminal's window handles.
Hello @jdnewmil, I have tried to perform the same and it worked for me.
Look at your diagnose report, I have noticed one thing and that is that the location of gcm is
AppPath: C:\Users\USER\AppData\Local\Programs\Git\mingw64\bin\git-credential-manager.exe
This seems to me like you have installed the gcm as a standalone app rather than installing it with git.
I would suggest for you to uninstall both git and gcm, download the newest git for windows https://git-scm.com/install/windows and go through the installation. I would also recommend stripping away all your custom git configuration just for the purpose of the testing to see if it works. Keep just the default config settings and only run git config --global credential.helper manager
If the problem remains even after the installation, just reply to my message and I will look further.
Also, please remove all the personal information from the log files, I have removed those files for you, please feel free to upload them again.
Hey I am closing this issue due to lack of responsiveness. If this issue persist, feel free to create a new issue.