How to set the TERM environment variable on Windows so that it works with Bash via SSH and locally using Git?

Background:

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

However, this caused a secondary problem when SSH'd in my Vagrant box, command-line applications such as Vim, Nano, and even Clear did not start, causing "msys: unknown terminal type" errors.

Then I tried to change TERM to "ansi" and I got better results during ssh, since the applications will work fine, but there are still formatting errors.

Question:

Is there a parameter for TERM in Windows environment variables that will work correctly for both my copy of Windows git and the Vagrant VM Bash shell via SSH?

+6
source share
1 answer

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 set-env.bat file from bills-kitchen )

+2
source

Source: https://habr.com/ru/post/982226/


All Articles