Certain commands, such as git log
result in an annoying error message before the expected output is produced on screen. The error message looks like this:
I only use the Git portable edition, and do not see this issue.
vonc@VONCA D:\git
> git version
git version 2.21.0.windows.1
I did recommended set TERM=msys in 2014, but that should not be needed nowadays (2019).
Check if the issue persists when using Git in a simplified PATH in your regular CMD session:
set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
set GIT_HOME=C:\Path\to\Git
set PATH=%GIT_HOME%;%GIT_HOME%\bin;%GIT_HOME%\usr\bin;%GIT_HOME%\mingw64\bin;%PATH%
git log
git-for-windows/git issue 1572 mentions:
The warning message is not from
git
, but fromless
, which is used as the default pager bygit
.If you specify
less -d
aspager
, less will not warn about your terminal:
$ less --help | grep -A 1 dumb
-d ........ --dumb
Dumb terminal.
You can configure this with:
git config --global core.pager "less -d"
you can also use:
git config --global core.pager "TERM=cygwin less"
.
This will give you a more functional pager.Yet another solution is to create a batch file:
$ cat less.bat @set TERM= @less.exe %*
And use it as your pager:
git config --global core.pager "/c/path/to/batch/less.bat".
In my case, upgrade my old Windows 7 desktop to Windows 10, and found out TERM
system variable had been added by Strawberry Perl and set to dumb
decades ago.
So remove the TERM
system variable from Windows 10 environment variables
settings fix this issue without any further updates.
Now, type echo $TERM
shown the default value: xterm-256color
works for everything...