8

Background:

When using my Windows version of git in Powershell I found that I got the error "terminal is not fully functional" so I used the second solution posted here (i.e. change TERM to msys) to fix the problem.

However, this caused a secondary problem that when SSH'd into my Vagrant box, command line apps like Vim, Nano and even Clear would not run, producing errors "msys: unknown terminal type."

I then attempted to change TERM to "ansi" and I got better results during ssh, in that the apps would run fine, but there are still formatting errors.

Question:

Is there a setting for TERM in windows environment variables that will work properly for both my Windows copy of Git and the Vagrant VM Bash shell via SSH?

Lutz Prechelt
  • 36,608
  • 11
  • 63
  • 88
Sirrah
  • 1,681
  • 3
  • 21
  • 34
  • Which version of git.exe are you using? I've seen the error you're describing while in PowerShell before, but I haven't had to deal with it in a while. I'm running git version 1.9.5.msysgit.0 (you can see your version by running `git --version`). – David Mohundro Mar 17 '15 at 16:59

1 Answers1

6

The combination that works best for me is:

:: set proper TERM to not break `vagrant ssh` terminal, 
:: see https://github.com/tknerr/bills-kitchen/issues/64
set TERM=cygwin

:: trick vagrant to detect colored output for windows, see here:
:: https://github.com/mitchellh/vagrant/blob/7ef6c5d9d7d4753a219d3ab35afae0d475430cae/lib/vagrant/util/platform.rb#L89
set ANSICON=true

:: mute the cygwin warning which otherwise comes on `vagrant ssh`
set CYGWIN=nodosfilewarning

(excerpt from the set-env.bat file from bills-kitchen)

Torben Knerr
  • 784
  • 6
  • 15
  • Note that I'm mostly using this from a plain ConEmu wrapped cmd.exe shell. Not sure if these are the best settings for powershell though. – Torben Knerr Mar 24 '15 at 23:45