The problem, as others have noted, is that your terminal is fine, but when Git calls a pager, it does not correctly interpret the ANSI color codes.
I would start by disabling LESS in your environment; it looks like you may have previously installed it for something hiding what Git needs. If that solves, thatβs all. If you really have to configure LESS , note that Git starts with FRSX by default, so be careful when changing if you don't need it.
If for any reason you want LESS in your environment to be different from what you want for Git, then the core.pager configuration variable is the ideal way to work with Git and the pager. To quote manpage:
The command that Git will use to display the paged image. May be overridden by the GIT_PAGER environment variable. Note that Git sets the LESS environment variable to FRSX if it is not set when the pager starts. You can change these settings by setting the LESS variable to a different value. Alternatively, these parameters can be overridden on a project basis or globally by setting the core.pager parameter. Setting core.pager does not affect the behavior of the LESS environment variable above, so if you want to override the default settings for w27, you must be explicit. For example, to disable the S parameter in reverse, set core.pager to less -+$LESS -FRX . This will be passed to the shell using Git, which converts the final command to LESS=FRSX less -+FRSX -FRX .
This, combined with some knowledge of the parameters you need, should get you where you want to be. (The backward compatibility ability works by disabling all options currently in LESS and then adding back the ones you want.)
Cascabel Dec 13 2018-11-11T00: 00Z
source share