-
Notifications
You must be signed in to change notification settings - Fork 2.7k
winansi.c: Fix colourization on Cygwin pseudo terminals. #275
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
Conversation
Yes, please, as a single commit. Just use |
When you say "re-wrap at 76 columns/line" are you talking about the source code or the commit message? |
Just the commit message. Source code should be wrapped at 80 columns/line. Thank you! |
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 <[email protected]>
winansi.c: Fix colourization on Cygwin pseudo terminals.
Thank you! BTW is the first |
If I don't specify the pager, then Msys's less.exe gets spawned (In process explorer I see C:\Program Files\Git\usr\bin\less.exe getting spawned). I tried overriding the pager using the PAGER and GIT PAGER variables to use cygwin's less.exe. In Process Explorer I now see c:\cygwin\bin\less.exe getting spawned, but it makes no difference. Git's output goes flying up the screen, as if it is not being piped into less |
Hmm. I guess this needs serious investigation, still. Unfortunately I do not have the time right now, preparing the release... |
(In order not to forget, and to give volunteers a chance to work on it, I reopened #267.) |
winansi.c: Fix colourization on Cygwin pseudo terminals.
winansi.c: Fix colourization on Cygwin pseudo terminals.
winansi.c: Fix colourization on Cygwin pseudo terminals.
winansi.c: Fix colourization on Cygwin pseudo terminals.
winansi.c: Fix colourization on Cygwin pseudo terminals.
winansi.c: Fix colourization on Cygwin pseudo terminals.
winansi.c: Fix colourization on Cygwin pseudo terminals.
winansi.c: Fix colourization on Cygwin pseudo terminals.
winansi.c: Fix colourization on Cygwin pseudo terminals.
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