mingw: adjust is_console() to work with stdin
commitfee807c5f6da43ba03f4f92d832fd625ab57b0d7
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Thu, 22 Dec 2016 17:08:57 +0000 (22 18:08 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 22 Dec 2016 17:58:20 +0000 (22 09:58 -0800)
treebb7c9dd7f4365cc5ecda583430b97e58afa0dead
parentcbb3f3c9b1975c9bdd07f24fc4ef4e504507adaa
mingw: adjust is_console() to work with stdin

When determining whether a handle corresponds to a *real* Win32 Console
(as opposed to, say, a character device such as /dev/null), we use the
GetConsoleOutputBufferInfo() function as a tell-tale.

However, that does not work for *input* handles associated with a
console. Let's just use the GetConsoleMode() function for input handles,
and since it does not work on output handles fall back to the previous
method for those.

This patch prepares for using is_console() instead of my previous
misguided attempt in cbb3f3c9b1 (mingw: intercept isatty() to handle
/dev/null as Git expects it, 2016-12-11) that broke everything on
Windows.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/winansi.c