How do I enable msysgit colored output when using console2

放肆的年华 提交于 2019-12-03 04:07:46

问题


I'm having a hard time enabling git colored output on windows when using console2.

To trick git I've already SET TERM = 'cygwin'. This enabled the colors from a standard cmd.exe prompt but not in console2. I've verified that console2 can see the env var as well.

Anyone know how to get this working?


回答1:


Ok, wow. The solution is to disable custom font color in console2. If enabled, it overrides the expected colors.

I use a custom color to give me opaque text when using c2's alpha transparency. I completely forgot about it.




回答2:


That is strange because, with a default installation of console2 (2.00.145) and msysgit (1.6.5) on Windows7, I do have the colors (without setting any particular environment variable):

alt text http://img690.imageshack.us/img690/981/console2.png

This is consistent with TheDeeno's since no custom font colors are defined in a default installation.




回答3:


This is not directly answering your question but an important point regarding ANSI colored text in Console2. Console2 runs a cmd.exe instance by default, which does not support ANSI colors. If you change your shell (via Console2's settings) to ansicon.exe you can get those beautiful colors. http://sourceforge.net/projects/console/forums/forum/143117/topic/1501012

If you want to run a Console2 bash shell with colors, add a tab with the following:

Shell: "C:\Program Files\ansi166\x64\ansicon.exe" c:\cygwin64\bin\bash --login -i"

Icon: C:\cygwin64\Cygwin-Terminal.ico

Note: Ensure that you are running compatible installs of each product (i.e. x86 vs x64).



来源:https://stackoverflow.com/questions/2445003/how-do-i-enable-msysgit-colored-output-when-using-console2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!