git, SSH_ASKPASS on windows
- by Martin Schreiber
I am writing a graphical git frontend for Linux and Windows
(MSEgit) based on MSEide+MSEgui. MSEgit has an internal console window which communicates with git by pipes. On Linux it uses a PTY so SSH asks for key unlocking passwords on the PTY.
On Windows I wrote a small password entry application and set the SSH_ASKPASS environment variable accordingly.
SSH calls the password application if git is started with CreateProcess() dwCreationFlags DETACHED_PROCESS set but the password entry window will not be focused, its taskbar icon flashes instead.
SSH does not run the password application if FreeConsole() is called to be sure that there is no attached console to MSEgit and git is started without DETACHED_PROCESS but CREATE_NO_WINDOW instead.
I assume a Windows equivalent of POSIX setsid() should be called.
How can I force SSH to use SSH_ASKPASS without the DETACHED_PROCESS flag?
If this is not possible, how can I ensure that the password entry window is focused?