aboutsummaryrefslogtreecommitdiff
path: root/config.mak.uname
diff options
context:
space:
mode:
authorKarsten Blees <blees@dcon.de>2016-04-27 17:16:37 +0200
committerJunio C Hamano <gitster@pobox.com>2016-05-26 13:12:02 -0700
commitf7f90e0f4f58d493242078d17c0eba41dd3f1f79 (patch)
tree6c76c808e7079ca145d87bf32e046e01f5510498 /config.mak.uname
parent0f8e831356d4f1a34baf46bb1a6b2d4c89ec9cb8 (diff)
downloadgit-f7f90e0f4f58d493242078d17c0eba41dd3f1f79.tar.gz
git-f7f90e0f4f58d493242078d17c0eba41dd3f1f79.tar.xz
mingw: make isatty() recognize MSYS2's pseudo terminals (/dev/pty*)
MSYS2 emulates pseudo terminals via named pipes, and isatty() returns 0 for such file descriptors. Therefore, some interactive functionality (such as launching a pager, asking if a failed unlink should be repeated etc.) doesn't work when run in a terminal emulator that uses MSYS2's ptys (such as mintty). However, MSYS2 uses special names for its pty pipes ('msys-*-pty*'), which allows us to distinguish them from normal piped input / output. On startup, check if stdin / stdout / stderr are connected to such pipes using the NtQueryObject API from NTDll.dll. If the names match, adjust the flags in MSVCRT's ioinfo structure accordingly. Signed-off-by: Karsten Blees <blees@dcon.de> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.mak.uname')
-rw-r--r--config.mak.uname3
1 files changed, 2 insertions, 1 deletions
diff --git a/config.mak.uname b/config.mak.uname
index 40d6b29ee..a88f13989 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -557,7 +557,8 @@ else
BASIC_LDFLAGS += -Wl,--large-address-aware
endif
CC = gcc
- COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0
+ COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY
+ EXTLIBS += -lntdll
INSTALL = /bin/install
NO_R_TO_GCC_LINKER = YesPlease
INTERNAL_QSORT = YesPlease