Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pagination and colour do not work from a minTTY cygwin prompt #267

Closed
cs96and opened this issue Aug 10, 2015 · 11 comments · Fixed by #275
Closed

Pagination and colour do not work from a minTTY cygwin prompt #267

cs96and opened this issue Aug 10, 2015 · 11 comments · Fixed by #275

Comments

@cs96and
Copy link

cs96and commented Aug 10, 2015

I used to use msysgit from a minTTY cygwin prompt with no pagination or colour issues. I recently upgraded to Git For Windows 2.4.6 RC5, and pagination and colour no longer work. E.g. doing "git log" will output the whole log to the window in black and white.

If I just run c:\cygwin\bin\bash.exe, then everything works OK.
If I run c:\cygwin\bin\mintty.exe then pagination and colour do not work.

I thought it might be something to do with the TERM envvar, which defaults to "cygwin" when I run bash, and "xterm" with minTTY. However I tried setting this to "cygwin" on minTTY but with no luck.

I find this slightly confusing as Git Bash uses minTTY with no problems at all.

@cs96and cs96and changed the title Pagination and colour do not work from a cygwin prompt Pagination and colour do not work from a minTTY cygwin prompt Aug 10, 2015
@dscho
Copy link
Member

dscho commented Aug 10, 2015

Git for Windows is not expected to play well with Cygwin. Please use Cygwin's own Git instead.

@dscho dscho closed this as completed Aug 10, 2015
@cs96and
Copy link
Author

cs96and commented Aug 10, 2015

For various reasons, cygwin's git is not usable for my use case, so I have to use msysgit or Git For Windows. Why did pagination and colour work OK with msysgit, but not with Git For Windows?

@dscho
Copy link
Member

dscho commented Aug 10, 2015

Please note that "msysgit" is not the correct term. Here is an explanation why: https://github.com/msysgit/msysgit/wiki/Relationship-to-Git-for-Windows

Why did pagination and colour work OK with msysgit, but not with Git For Windows?

That is a really broad and vague question.

I would still hazard a guess -- because I am bold -- that the reason is here: 3adef8d#diff-5a07b657681304b199c3bbacce334efdR558

Feel free to work from here and open a Pull Request!

@cs96and
Copy link
Author

cs96and commented Aug 12, 2015

I've figured out how to fix the colours on a cygwin minTTY console. I have posted a patch to fix it here http://pastebin.com/ksWHx2P9

I can't work out why pagination is not working though. It seems that 'less' is being spawned, but git's output is not being piped into it. I've tried looking in pager.c and run-command.c but can't work out why its not working. Any ideas?

@dscho
Copy link
Member

dscho commented Aug 12, 2015

@cs96and posting a patch on pastebin is not exactly what I asked you to do...

It would surprise me if less was spawned because the isatty() test is most likely failing.

Your patch is really, really hard to comment on, thanks to being snuck into a pastebin instead of opening a Pull Request.

   if ((!wcsstr(name, L"msys-") && !wcsstr(name, L"cygwin-")) || !wcsstr(name, L"-pty"))

Have you actually tried to write out name into a file, to see what it looks like?

@cs96and
Copy link
Author

cs96and commented Aug 12, 2015

I've created a pull request properly now.

Have you actually tried to write out name into a file, to see what it looks like?

Yes, the pty pipe names are very similar in msys and cygwin, except that msys ones begin with "msys-" and cygwin ones begin with "cygwin-" (as shown in the comment that I changed).

It would surprise me if less was spawned because the isatty() test is most likely failing.

The function that I changed (detect_msys_tty) hacks the ioinfo struct so that isatty returns true. Using Process Explorer I can see less.exe being spawned as a child of git.exe.

@dscho
Copy link
Member

dscho commented Aug 17, 2015

Reopening, as the pagination still does not work.

@cs96and
Copy link
Author

cs96and commented Aug 17, 2015

I set my pager to "c:/cygwin/bin/strace.exe -o d:/trace.txt c:/cygwin/bin/less.exe". After running "git log" in a cygwin minTTY window, I can see this in the trace log...

130 10370 [main] less 11540 isatty: 0 = isatty(1)
19 10389 [main] less 11540 isatty: 0 = isatty(1)

After running "git log" from a bog standard cygwin prompt (i.e. in a windows command prompt window running cygwin bash), the trace has this...

138 12301 [main] less 14196 isatty: 1 = isatty(1)
18 12319 [main] less 14196 isatty: 1 = isatty(1)

So it would seem that less.exe does not think that the minTTY window is a TTY, if it has been spawned from git.

@dscho
Copy link
Member

dscho commented Aug 17, 2015

I see very similar output, with one more data point: when I run the Git SDK and specify something like PAGER='/usr/bin/strace.exe -o /pager.log /usr/bin/less.exe' git log, I see 1 = isatty(1) in the output. However, if I call PAGER='/c/git-sdk-64/usr/bin/strace.exe -o /c/pager.log /c/git-sdk-64/usr/bin/less.exe' git log from Git for Windows (i.e. as installed via a user-facing installer), I see 0 = isatty(1) and the pager does not stop, either.

The funny thing is that calling /c/git-sdk-64/usr/bin/less.exe <some-file> works even from Git for Windows' Git Bash. It stops correctly after one page. However, if I call the same thing with /c/git-sdk-64/usr/bin/strace.exe -o /c/pager.log prefixed, it does not stop any longer!

So it looks as if the problem is much deeper.

@dscho
Copy link
Member

dscho commented Aug 27, 2015

@cs96and did you have any chance to dig deeper yet?

@cs96and
Copy link
Author

cs96and commented Aug 27, 2015

No sorry, not had a chance to look into it.

@dscho dscho closed this as completed in 6480ba5 Aug 31, 2015
dscho pushed a commit that referenced this issue Sep 10, 2015
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 3adef8d 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 #267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
dscho pushed a commit to dscho/git that referenced this issue Sep 18, 2015
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 3adef8d 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 git-for-windows#267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
dscho pushed a commit to dscho/git that referenced this issue Sep 29, 2015
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 3adef8d 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 git-for-windows#267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
dscho pushed a commit that referenced this issue Oct 5, 2015
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 3adef8d 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 #267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
dscho pushed a commit to dscho/git that referenced this issue Oct 18, 2015
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 3adef8d 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 git-for-windows#267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
dscho pushed a commit to dscho/git that referenced this issue Nov 7, 2015
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 3adef8d 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 git-for-windows#267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
dscho pushed a commit that referenced this issue Dec 11, 2015
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 3adef8d 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 #267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
dscho pushed a commit that referenced this issue Jan 5, 2016
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 3adef8d 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 #267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
dscho pushed a commit that referenced this issue Nov 13, 2016
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 3adef8d 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 #267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
dscho pushed a commit that referenced this issue Nov 14, 2016
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 3adef8d 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 #267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
dscho pushed a commit that referenced this issue Nov 16, 2016
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 3adef8d 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 #267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
dscho pushed a commit that referenced this issue Nov 17, 2016
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 3adef8d 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 #267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
dscho pushed a commit that referenced this issue Nov 17, 2016
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 3adef8d 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 #267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
dscho pushed a commit that referenced this issue Nov 18, 2016
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 3adef8d 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 #267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
dscho pushed a commit to dscho/git that referenced this issue Nov 18, 2016
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 3adef8d 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 git-for-windows#267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
dscho pushed a commit to dscho/git that referenced this issue Nov 24, 2016
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 3adef8d 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 git-for-windows#267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
dscho pushed a commit that referenced this issue Nov 29, 2016
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 3adef8d 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 #267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
dscho pushed a commit to dscho/git that referenced this issue Nov 29, 2016
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 3adef8d 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 git-for-windows#267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
dscho pushed a commit that referenced this issue Nov 30, 2016
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 3adef8d 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 #267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
dscho pushed a commit that referenced this issue Dec 6, 2016
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 3adef8d 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 #267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
dscho pushed a commit that referenced this issue Dec 12, 2016
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 3adef8d 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 #267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
dscho pushed a commit to dscho/git that referenced this issue Dec 22, 2016
Git only colours the output and uses pagination if isatty() returns 1.
MSYS2 and Cygwin emulate pseudo terminals via named pipes, meaning that
isatty() returns 0.

f7f90e0 (mingw: make isatty() recognize MSYS2's pseudo terminals
(/dev/pty*), 2016-04-27) fixed this for MSYS2 terminals, but not for
Cygwin.

The named pipes that Cygwin and MSYS2 use are very similar. MSYS2 PTY pipes
are called 'msys-*-pty*' and Cygwin uses 'cygwin-*-pty*'. This commit
modifies the existing check to allow both MSYS2 and Cygwin PTY pipes to be
identified as TTYs.

Note that pagination is still broken when running Git for Windows from
within Cygwin, as MSYS2's less.exe is spawned (and does not like to
interact with Cygwin's PTY).

This partially fixes git-for-windows#267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho pushed a commit to dscho/git that referenced this issue Dec 22, 2016
Git only colours the output and uses pagination if isatty() returns 1.
MSYS2 and Cygwin emulate pseudo terminals via named pipes, meaning that
isatty() returns 0.

f7f90e0 (mingw: make isatty() recognize MSYS2's pseudo terminals
(/dev/pty*), 2016-04-27) fixed this for MSYS2 terminals, but not for
Cygwin.

The named pipes that Cygwin and MSYS2 use are very similar. MSYS2 PTY pipes
are called 'msys-*-pty*' and Cygwin uses 'cygwin-*-pty*'. This commit
modifies the existing check to allow both MSYS2 and Cygwin PTY pipes to be
identified as TTYs.

Note that pagination is still broken when running Git for Windows from
within Cygwin, as MSYS2's less.exe is spawned (and does not like to
interact with Cygwin's PTY).

This partially fixes git-for-windows#267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
fengguang pushed a commit to 0day-ci/git that referenced this issue Dec 22, 2016
Git only colours the output and uses pagination if isatty() returns 1.
MSYS2 and Cygwin emulate pseudo terminals via named pipes, meaning that
isatty() returns 0.

f7f90e0 (mingw: make isatty() recognize MSYS2's pseudo terminals
(/dev/pty*), 2016-04-27) fixed this for MSYS2 terminals, but not for
Cygwin.

The named pipes that Cygwin and MSYS2 use are very similar. MSYS2 PTY pipes
are called 'msys-*-pty*' and Cygwin uses 'cygwin-*-pty*'. This commit
modifies the existing check to allow both MSYS2 and Cygwin PTY pipes to be
identified as TTYs.

Note that pagination is still broken when running Git for Windows from
within Cygwin, as MSYS2's less.exe is spawned (and does not like to
interact with Cygwin's PTY).

This partially fixes git-for-windows#267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
gitster pushed a commit to git/git that referenced this issue Dec 22, 2016
Git only colours the output and uses pagination if isatty() returns 1.
MSYS2 and Cygwin emulate pseudo terminals via named pipes, meaning that
isatty() returns 0.

f7f90e0 (mingw: make isatty() recognize MSYS2's pseudo terminals
(/dev/pty*), 2016-04-27) fixed this for MSYS2 terminals, but not for
Cygwin.

The named pipes that Cygwin and MSYS2 use are very similar. MSYS2 PTY pipes
are called 'msys-*-pty*' and Cygwin uses 'cygwin-*-pty*'. This commit
modifies the existing check to allow both MSYS2 and Cygwin PTY pipes to be
identified as TTYs.

Note that pagination is still broken when running Git for Windows from
within Cygwin, as MSYS2's less.exe is spawned (and does not like to
interact with Cygwin's PTY).

This partially fixes git-for-windows#267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
dscho pushed a commit that referenced this issue Jan 11, 2017
Git only colours the output and uses pagination if isatty() returns 1.
MSYS2 and Cygwin emulate pseudo terminals via named pipes, meaning that
isatty() returns 0.

f7f90e0 (mingw: make isatty() recognize MSYS2's pseudo terminals
(/dev/pty*), 2016-04-27) fixed this for MSYS2 terminals, but not for
Cygwin.

The named pipes that Cygwin and MSYS2 use are very similar. MSYS2 PTY pipes
are called 'msys-*-pty*' and Cygwin uses 'cygwin-*-pty*'. This commit
modifies the existing check to allow both MSYS2 and Cygwin PTY pipes to be
identified as TTYs.

Note that pagination is still broken when running Git for Windows from
within Cygwin, as MSYS2's less.exe is spawned (and does not like to
interact with Cygwin's PTY).

This partially fixes #267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho pushed a commit that referenced this issue Jan 11, 2017
Git only colours the output and uses pagination if isatty() returns 1.
MSYS2 and Cygwin emulate pseudo terminals via named pipes, meaning that
isatty() returns 0.

f7f90e0 (mingw: make isatty() recognize MSYS2's pseudo terminals
(/dev/pty*), 2016-04-27) fixed this for MSYS2 terminals, but not for
Cygwin.

The named pipes that Cygwin and MSYS2 use are very similar. MSYS2 PTY pipes
are called 'msys-*-pty*' and Cygwin uses 'cygwin-*-pty*'. This commit
modifies the existing check to allow both MSYS2 and Cygwin PTY pipes to be
identified as TTYs.

Note that pagination is still broken when running Git for Windows from
within Cygwin, as MSYS2's less.exe is spawned (and does not like to
interact with Cygwin's PTY).

This partially fixes #267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants