fusesource/jansi — pull request #26 by ghquant (2014-01-22 01:39:46+00:00)
Title: missing functions for default text and background colors on Windows

Hey guys,

last day, my anger beat my patience... I'm using the Grails Web Application Framework for some projects since over a year now and it's console output leaves an unfinished/unprofessional impression. On Linux it looks much better.

My plan was to fix it with a contribution to the Grails code-base again. Many hours later, the workaround for Windows special treatment was working. Like many people before me, who uses jansi, i came to the same conclusion that Windows simply doesn't support any way to get or set the default text or background colors on a standard console window.

Grails uses jansi for it's console output. So i pulled jansi's source, to understand how to use it the right way. Found out it uses a dedicated Windows Console API. Looking how that API works: it supported to read and set default colors. But what is wrong with that, why does it not work in jansi?

Then hit me the lightning. That code was simply not implemented. Forgotten maybe.

This pull request is a pretty simple one, but it helps a lot to emulate the same behaviour on different platforms. Setting the default text and background color is a core functionality of your API (and ANSI).

I sacrificed over a day for this small outcome. You give me much reward if you integrate this pull-request and publish a new release quickly. Then God don't need to kill a innocent kitten each day ;)

Thank you for your time!