37

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?

Dane O'Connor
  • 75,180
  • 37
  • 119
  • 173

3 Answers3

69

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.

Dane O'Connor
  • 75,180
  • 37
  • 119
  • 173
  • 5
    I upvoted this answer at least a year ago when I had the same problem and this answer solved it. Right now I am setting up Console2 at another computer, and same problem occurred and google lead me here. SO should allow to upvote again aswers after a year or so. – del-boy Jun 08 '12 at 18:25
7

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.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • darn, this _is_ strange. I'm using different versions of console2 (2.00.144) and msysgit (1.7.0.2). Maybe that's the issue? Can you post your git color config? – Dane O'Connor Mar 15 '10 at 05:49
  • @TheDeeno: thank you for the feedback, I have updated my answer to reflect the root cause you mention in your post. – VonC Mar 15 '10 at 06:32
  • 4
    For those who only read this answer, be sure to check that you haven't defined a custom color in console2. This will override the color output of all your console apps. – Dane O'Connor Apr 20 '10 at 00:10
4

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).

Derek Greer
  • 15,454
  • 5
  • 45
  • 52
Sridhar Sarnobat
  • 25,183
  • 12
  • 93
  • 106
  • Console2 can actually wrap any shell that uses conhost.exe, like cmd.exe, PowerShell, Cygwin bash, Python shell. @thedeeno said he was using Cygwin, which has colours. If you want colours, as well as a hell of a lot of other extra functionality, you can use TCC/LE instead of cmd.exe (also within Console2), which is compatible and a lot more powerful. – paradroid Dec 02 '12 at 11:12
  • yes, but to use with putty you will actually need ANSICON (now on [new location](https://github.com/adoxa/ansicon/downloads)): http://blog.jimueller.com/post/29709142253/use-putty-with-console2 – Miguel May 09 '13 at 04:45