When I was using Git Bash (Git For Windows) if a command (like git diff
) had a short output (I'm guessing smaller than the terminal's height) it would just print as output, now in Babun (Cygwin) every Git command seems to be viewed in less even if it's one line or completely empty. "Every" is perhaps too bold, git status
doesn't. It just seems like there was some pre-bundled setting in one of these that the other doesn't have and I don't know what it is.
How can I make Git behave so that when there is a short output it doesn't use less and instead just outputs it.
Edit: In git bash my pager for git is 'less -x4
' (for 4 width tabs), no -F
. Also, the environment variables LESS
, PAGER
, and GIT_PAGER
are empty. So I have no idea why git bash is behaving like this, but luckily I've gotten some help on how to make Babun (Cygwin) start.
Hindsight update: (This is probably wrong, see 2017-01-12 note.) I think that Git For Windows and/or the default terminal doesn't wipe the screen when closing less -- I saw this behavior somewhere else that was unrelated (closing less and the screen not being wiped) so I think that's what is happening. Why Cygwin and the mintty terminal does the wipe and MINGW (or Msys2? Whatever Git For Windows uses) on the Windows terminal does not is beyond my realm of knowledge.
Hindsight update post Googling: Turns out the above revelation was enough info to Google the solution! I will post it now.
2017-01-12: Looks like it wasn't wiping it precisely because LESS
was unset. According to man git config
...
core.pager [...] When the LESS environment variable is unset, Git sets it to FRX (if LESS environment variable is set, Git does not change it at all). If you want to selectively override Git’s default setting for LESS, you can set core.pager to e.g. less -S. This will be passed to the shell by Git, which will translate the final command to LESS=FRX less -S. [...]