-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Comments
Git for Windows is not expected to play well with Cygwin. Please use Cygwin's own Git instead. |
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? |
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
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! |
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? |
@cs96and posting a patch on pastebin is not exactly what I asked you to do... It would surprise me if 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 |
I've created a pull request properly now.
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).
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. |
Reopening, as the pagination still does not work. |
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) 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) So it would seem that less.exe does not think that the minTTY window is a TTY, if it has been spawned from git. |
I see very similar output, with one more data point: when I run the Git SDK and specify something like The funny thing is that calling So it looks as if the problem is much deeper. |
@cs96and did you have any chance to dig deeper yet? |
No sorry, not had a chance to look into it. |
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
The text was updated successfully, but these errors were encountered: