mirror of
https://github.com/git/git
synced 2024-09-13 13:24:41 +00:00
Windows: Make OpenSSH properly detect tty detachment.
Apparently, CREATE_NO_WINDOW makes the OS tell the process that it has a console, but without actually creating the window. As a result, when git is started from GUI, ssh tries to ask its questions on the invisible console. This patch uses DETACHED_PROCESS instead, which clearly means that the process should be left without a console. The downside is that if the process manually calls AllocConsole, the window will appear. A similar thing might occur if it calls another console executable. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Acked-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
6331adb9c4
commit
19fb896f5b
|
@ -536,12 +536,16 @@ static pid_t mingw_spawnve(const char *cmd, const char **argv, char **env,
|
||||||
* would normally create a console window. But
|
* would normally create a console window. But
|
||||||
* since we'll be redirecting std streams, we do
|
* since we'll be redirecting std streams, we do
|
||||||
* not need the console.
|
* not need the console.
|
||||||
|
* It is necessary to use DETACHED_PROCESS
|
||||||
|
* instead of CREATE_NO_WINDOW to make ssh
|
||||||
|
* recognize that it has no console.
|
||||||
*/
|
*/
|
||||||
flags = CREATE_NO_WINDOW;
|
flags = DETACHED_PROCESS;
|
||||||
} else {
|
} else {
|
||||||
/* There is already a console. If we specified
|
/* There is already a console. If we specified
|
||||||
* CREATE_NO_WINDOW here, too, Windows would
|
* DETACHED_PROCESS here, too, Windows would
|
||||||
* disassociate the child from the console.
|
* disassociate the child from the console.
|
||||||
|
* The same is true for CREATE_NO_WINDOW.
|
||||||
* Go figure!
|
* Go figure!
|
||||||
*/
|
*/
|
||||||
flags = 0;
|
flags = 0;
|
||||||
|
|
Loading…
Reference in a new issue