views:

582

answers:

3

Trying out the examples found on pleac.sf.net, I'm not able to get an example of ANSI colors to work on my WinXP box (Works fine on MacOS). What I've found is that on my WinXP machine, in both cygwin & DOS prompts, groovysh --color (and 'groovysh --terminal=unix') shows escape codes rather than the expected colored prompt. grep --color works just fine in the cygwin terminal. I can't find anything obvious that I'm doing wrong. Any ideas?

Note: I'm using Groovy 1.6.0

Update: I've tried adding ANSI.sys to my config.nt mentioned here Groovy-dev Mailing List but it didn't fix the problem (tried rebooting too).

A: 

The Groovy site says to do this for cygwin:

groovysh --terminal=unix

For the winxp command shell, as far as I know, there is no ANSI support at all, not even with ansi.sys. Colors are supported through some MS API only.

"groovysh --terminal=unix" gives the same result as "groovysh --color" - I get escape codes rather than the colored prompt. I've updated the question
Peter
A: 

A workaround in cygwin is to launch xterm or rxvt and run it there.

+1  A: 

The thing is, you'd have to add DOSONLY to your CONFIG.NT as well to make the ANSI.SYS driver work, and then it would only work for COMMAND.COM which emulates DOS 5.0. Regular Command Prompts (CMD.EXE) do not support ANSI colors at all, afaict.

I don't know much about cygwin handles it.

Coding With Style