PHPUnit Windows command box nice colors

14

4

I have PHPunit installed on a Windows machine. But I don't get nice output on my command line. With the green colours. Someone on the PHPunit mailing list told me I need the ansi.sys driver.

Can someone tell me how to do it so that PHPunit will use the driver?

I tried to add

device=%SystemRoot%\System32\ansi.sys

to my config.nt, but that doesn't give me the desired output. Any ideas?

sanders

Posted 2010-11-07T10:33:56.437

Reputation: 189

Answers

17

enter image description here

ANSI Command Line Colors under Windows (Nov 2010 by SOFTKUBE s.a.r.l.)

Please remember that the download link in the article does not lead to the files with binaries. Please follow this to get source / binary packages.

Brandon

Posted 2010-11-07T10:33:56.437

Reputation: 186

2

The ANSICON project, linked in this answer has moved to GitHub

– Richard – 2011-04-30T17:53:59.607

1

Thank you Richard. The updated post now includes a link to the GitHub project: http://softkube.com/blog/ansi-command-line-colors-under-windows/

– Mario Awad – 2012-10-24T18:05:29.503

2

Windows Console does not use MS-DOS drivers and does not read config.nt. (Those are purely for NTVDM.)

If you need an ANSI-compatible terminal, check out mintty.

user1686

Posted 2010-11-07T10:33:56.437

Reputation: 283 655

This solution looks too complicated since mintty is a part of a whole series of programs. Can't I add it to my regular command prompt? – sanders – 2010-11-09T08:34:49.807

2@sanders Doesn't mean you have to use the whole series; mintty works with cmd.exe too. And no, you cannot add ANSI support to the Windows Console (as I said on my answer) - you will have to use a different terminal emulator. Besides mintty, there's also PuTTYcyg. (Bear in mind that the "command prompt" consists of two distinct parts - the "shell" (in Unix terms) or "command interpreter" (cmd.exe) interprets your commands and executes them, and the "terminal" (in this case, Windows Console or mintty) displays everything on screen. It is the latter that handles colours.) – user1686 – 2010-11-09T20:35:13.007

-1

By far the easiest way I've found of getting a nice-looking terminal in Windows is to use Cmder.

It gives you full control over the palette, has transparency, allows saving of themes, etc, and is a portable app, so no messing with the registry or installing drivers is required (I found it after realising that ANSICON, which I'd been using before, was causing a number of commands to crash every time on my machine).

Before using Cmder, I was using mintty to run PHPUnit (because my other terminal was messing up the colours), and then Git Bash for everything else (because mintty didn't seem to get the colours right for, eg. git status). Cmder works both with PHPUnit and other instances (git commands, etc) where terminal output is coloured, and it's also configurable without needing to mess with drivers, registry, etc.

Nick F

Posted 2010-11-07T10:33:56.437

Reputation: 204

Hey, why the downvote? I didn't mention PHPUnit, but I use PHPUnit on Cmder and it works perfectly. I've amended the post to make this explicit in case that was the problem... – Nick F – 2015-06-14T22:26:49.643