如何在Windows中设置TERM环境变量,以便通过SSH和Bit本地使用Bash?

Sir*_*rah 6 windows git bash powershell vagrant

背景:

在Powershell中使用我的Windows版本的git时,我发现我收到错误"终端功能不全"所以我使用了这里发布的第二个解决方案(即将TERM更改为msys)来解决问题.

然而,这导致了一个次要问题,当SSH进入我的Vagrant盒子时,命令行应用程序如Vim,Nano甚至Clear都无法运行,从而产生错误"msys:unknown terminal type".

然后我尝试将TERM更改为"ansi",并且在ssh期间我获得了更好的结果,因为应用程序运行正常,但仍然存在格式错误.

题:

Windows环境变量中是否有TERM设置,可以通过SSH为我的Windows副本Git和Vagrant VM Bash shell正常工作?

Tor*_*err 6

最适合我的组合是:

:: 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
Run Code Online (Sandbox Code Playgroud)

(摘自set-env.batbills-kitchen文件