Git Portable - WARNING terminal is not fully functional

后端 未结 2 1122
感情败类
感情败类 2021-01-14 23:48

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:

相关标签:
2条回答
  • 2021-01-15 00:34

    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 from less, which is used as the default pager by git.

    If you specify less -d as pager, 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".
    
    0 讨论(0)
  • 2021-01-15 00:36

    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...

    0 讨论(0)
提交回复
热议问题