I'd like to have colored git logs with paging on cygwin.
I managed to get colored logs with
git log --color=always
If I do
git log --color=always | less
I get paging, but the color commands are printed instead of interpreded
ESC[33mcommit b4dbe28f459adf0df1784d3a597628cc27abf836ESC[m
Author: Ernst Pluess <[email protected]>
Date: Thu Apr 18 13:23:07 2013 +0200
Changed to UTF-8
On my OSX box colors and paging is the default behaviour for git log on the shell. How can I get the same for cygwin on Windows.
I was able to configure git globally (on cygwin at least) by running
git config --global core.pager 'C:/cygwin64/bin/less.exe'
This way running git log
shows a paged and colorized output.
Use
less -R
instead of just less to pass color ANSI control characters through to the terminal.
You can also set the LESS environment variable to
LESS=-R
to make this default behaviour.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With