Search code examples
gitless

Git less shows an error message and bad output. How can I fix it?


After installing delta and some configuration around it, Git less (the default pager) seems to have gotten screwed up. For example, if I do a git log, the results look like this:

>git log
-" must be followed by 1 or 2 chars
Press RETURN to continue

The logs that follow have strange formatting with a bunch of "ESC" and other oddities:

ESC[33mcommit fcb45[...]

I've found the actual error message in less here:

https://github.com/gdamore/less-fork/blob/master/optfunc.c#L489

But how do I fix this?

I've tried:

  1. Reinstalling Git.
  2. Uninstalling Git, deleting C:\Program Files\Git, and then reinstalling.
  3. Deleting the Delta pager and removing it from PATH.

It would make sense to me to reinstall Less, but how do I do that?


Solution

  • After more searching around, I discovered that while trying to get Delta to work with git add -p, I created this environment variable:

    LESS environment variable

    When I deleted this and restarted my Windows command prompt, the problem went away.