mirror of
https://github.com/git/git.git
synced 2026-01-18 06:34:21 +00:00
mingw: Don't ask the user yes/no questions if they can't see the question.
If the stdout of the command is connected to a terminal but the stderr has been redirected, the odds are good that the user can't see any question we print out to stderr. This will result in a "mysterious hang" while the app is waiting for user input. It seems better to be conservative, and avoid asking for input whenever the stderr is not a terminal, just like we do for stdin. Signed-off-by: bert Dvornik <dvornik+git@gmail.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
committed by
Johannes Schindelin
parent
12a5a33704
commit
c5ba0d9fa2
@@ -175,7 +175,7 @@ static int ask_user_yes_no(const char *format, ...)
|
||||
return !run_command_v_opt(retry_hook, 0);
|
||||
}
|
||||
|
||||
if (!isatty(_fileno(stdin)))
|
||||
if (!isatty(_fileno(stdin)) || !isatty(_fileno(stderr)))
|
||||
return 0;
|
||||
|
||||
while (1) {
|
||||
|
||||
Reference in New Issue
Block a user