Skip to content

Commit

Permalink
mingw (git_terminal_prompt): do fall back to CONIN$/CONOUT$ method
Browse files Browse the repository at this point in the history
To support Git Bash running in a MinTTY, we use a dirty trick to access
the MSYS2 pseudo terminal: we execute a Bash snippet that accesses
/dev/tty.

The idea was to fall back to writing to/reading from CONOUT$/CONIN$ if
that Bash call failed because Bash was not found.

However, we should fall back even in other error conditions, because we
have not successfully read the user input. Let's make it so.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Sep 22, 2022
1 parent 8c5823d commit 26fa080
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compat/terminal.c
Expand Up @@ -483,7 +483,7 @@ char *git_terminal_prompt(const char *prompt, int echo)

/* try shell_prompt first, fall back to CONIN/OUT if bash is missing */
char *result = shell_prompt(prompt, echo);
if (result || errno != ENOENT)
if (result)
return result;

#endif
Expand Down

0 comments on commit 26fa080

Please sign in to comment.