mirror of
https://github.com/git/git.git
synced 2026-01-27 02:48:32 +00:00
Git only colours the output and uses pagination if isatty() returns 1.
MSys and Cygwin emulate pseudo terminals via named pipes, meaning that
isatty() returns 0.
Commit 3adef8de55 fixed this for MSys
terminals, but not Cygwin.
The named pipes that Cygwin and Msys use are very similar. MSys PTY pipes
are called 'msys-*-pty*' and Cygwin uses 'cygwin-*-pty*'. This commit
modifies the existing check to allow both MSys and Cygwin PTY pipes to be
identified as TTYs.
Note that Pagination is still broken on Cygwin. less.exe is spawned (as
seen in Process Explorer and using GIT_TRACE=1), but the output is not
being piped into it.
This partially fixes https://github.com/git-for-windows/git/issues/267
Signed-off-by: Alan Davies <alan.n.davies@gmail.com>