Robin's Blog

How to: Fix ‘WARNING: terminal is not fully functional’ error on Windows with Cygwin/Msysgit

For a while now I’ve been frustrated by an error that I get whenever I’m using git on Windows. When I try and run certain git commands – such as git log or git diff – I get the following message:

Git error message stating "WARNING: terminal not fully functional"

Git error message stating “WARNING: terminal not fully functional”

The error message “WARNING: terminal not fully functional” appears, but if you press return to continue, the command runs ok (albeit without nice colours). I’d just put up with this for ages, but decided to fix it today – and the fix is really simply. Basically, the problem is that the TERM environment variable is set to something strange, and git can’t cope with it – so warns you that there might be trouble.

So, to fix this, you just need to make sure that the TERM environment variable is set to “xterm”, which is the standard graphical terminal on Linux machines. There are a number of ways that you can do this:

  • Set this variable using the built-in Windows interface – see these instructions
  • Use a helpful tool to make this easier (particularly if you often set other environment variables, as I do), like Rapid Environment Editor
  • Set it in an initialisation batch script – such as the init.bat file that is used by the Cmder swish Windows command-line tool

Once you’ve set this (you can even test it by just running set TERM=xterm on the command line), everything should work fine – and you’ll get colours back again:

GitErrorFixed


If you found this post useful, please consider buying me a coffee.
This post originally appeared on Robin's Blog.


Categorised as: Computing, How To, Linux, Windows


9 Comments

  1. I had the same problem and your post helped me to fix it. Thanks.

  2. Andrew Dennison says:

    Very helpful. & the link to Rapid Environment Editor too

  3. Dewi says:

    Robin, I’m on a surface pro 3 and I know how to change the path variables but I don’t see a term variable.. can you please clarify.

  4. Robin Wilson says:

    I think if you don’t see one then you should just create an environment variable called TERM and set it to ‘xterm’ and see if that helps.

  5. Hai Vu says:

    This help greatly. Thank you

  6. ayman says:

    Thank you <3

  7. Jessica Ho says:

    This helped me to fix the same issue here. Thanks a lot! 🙂

  8. Greywolf says:

    SHORT: The proper fix for this is to set GIT_PAGER to the empty string (“”), then it won’t try to fiddle about with your term. (export GIT_PAGER=/bin/cat also works well.)

    RANT:
    The fact that it assumes ANSI/xterm is insulting. I don’t expect that it should try to incorporate curses, but if you don’t have a TERM set or if you don’t have it set to something ansi-compatible, it should not be making assumptions about your output device. I actually have occasion to use git on various old-school CRT non-ANSI spec terminals, and have had to write a wrapper for git because of this.

  9. fegyi says:

    hey thanks for the fix, I had this issue with MSYS2 so I just set the terminal configuration to xterm and restarted the entire MSYS2. Since then I’m good. Just mentioned here in case anybody have the same issue

Leave a Reply

Your email address will not be published. Required fields are marked *