Hi,
On Fri, 24 Jun 2016, Erik Faye-Lund wrote:
> On Thu, Jun 23, 2016 at 10:19 PM, Stephen Morton
> <
stephen....@gmail.com> wrote:
> > I'm trying run git for windows within a cygwin bash/mintty terminal (*).
> > Everything mostly works, but some terminal emulation stuff does not work
> >
> > 'git log' is not coloured by default, although it will work if I manually do
> > 'git log --color'
>
> The problem here is that your terminal doesn't support colors *the
> windows way*, only the unix way. Git for Windows, being a Windows
> program does not know about the unix way.
To add even more information: MinTTY, whether it runs in its Cygwin
incarnation or in its MSYS2 one, requires an emulated /dev/tty to interact
correctly with the pager. The problem you have is that Cygwin's MinTTY
uses Cygwin's emulation, and that is similar to, but still incompatible
with, MSYS2's emulation. And it is the latter that is used by Git for
Windows.
> The fact that explicitly setting colors works, is because when Git for
> windows has no idea how to output colors, yet it was requested, it'll
> just output ANSI color sequences, which is "the unix way" above. I'd
> actually consider that latter part a minor bug, but I'm not opposed to
> leaving it that way to keep this work-flow working.
>
> Anyway, you might want to try "git config --global color.ui true" to
> avoid having to specify this over and over again.
>
> > The pager does not work.
>
> You probably want to play around with the core.pager config. There's a
> section on
https://git-scm.com/docs/git-config about how that config
> variable works.
Indeed. If you override the pager to be *Cygwin*'s less.exe, it might just
work.
While I am sympathetic to the woes you have, there is too much on my plate
to even try to tackle this problem.
Stephen, if you want to give it a try, and do not shy away from hacking on
the MSYS2 runtime, I am of course more than happy to point you to the code
locations that would need to be patched for MSYS2's less.exe to at least
try to access Cygwin's tty emulation.
Ciao,
Johannes