Replies: 2 comments 2 replies
-
You probably want to run a variation of Git for Windows' wiki page about auto-starting |
Beta Was this translation helpful? Give feedback.
-
While the Git built in SSH solution is certainly workable there are other options you can test and see whether they work better for you. One would be switching to Windows supplied OpenSSH (and enabling the Windows OpenSSH Agent service). You'll have to modify your Another option would be to use KeePass together with KeeAgent plugin. This way you do not have to change which OpenSSH binaries are used and can (with an experimental setting) talk to both Windows OpenSSH and Git supplied OpenSSH. KeeAgent is its own SSH Agent and would supplant the Git Bash supplied one (and obviously conflicts wit the Windows OpenSSH one as well):
|
Beta Was this translation helpful? Give feedback.
-
Setup
defaults?
to the issue you're seeing?
Details
None - calling directly from Win-R run prompt (so, legacy cmd terminal).
Minimal, Complete, and Verifiable example
this will help us understand the issue.
Git to run, with success or error, and exit when done, leaving any ssh-agent processes that were spawned still running.
The legacy cmd console window remains open, after the process has exited, until closed manually, or until the ssh-agent process spawned within the git wrapper is killed. Closing the terminal also closes the ssh-agent.
Interestingly, if SSH was called several times (because of a connection error/retry?), then one of the ssh-agents disconnects correctly/successfully, and one gets "stuck" to the terminal process.
URL to that repository to help us with testing?
No - this isn't necessarily a bug per se, what I'm doing is clearly not "expected". I'm just very perplexed by this behavior.
If the "ssh-agent" line in the wrapper file is commented out, then the behavior is the same as without the wrapper at all (console closes / completes normally).
If git is called from within a "Git Bash" shell (regardless of the terminal), or even a Cmd shell in another terminal like "Windows Terminal", then it completes normally (regardless of whether the wrapper calls "ssh-agent" or not).
In case it's not obvious, I'm trying to set things up so that an ssh-agent starts up correctly, just-in-time, even when git is called outside of git bash, eg in a GUI. My real script is obviously much more complicated/interesting than the above, but the above illustrates the perplexing "if an ssh-agent process is spawned in git, when not in the context of a bash shell, and in a windows console, then the git process does not complete until the ssh-agent process is terminated" behavior.
Beta Was this translation helpful? Give feedback.
All reactions