[darcs-users] Re: colour output/libcurses on windows(TM)

Stefan Rank e9725431 at student.tuwien.ac.at
Mon Apr 4 11:25:46 UTC 2005


on 04.04.2005 11:02 Csaba Henk said the following:
> On 2005-04-03, Peter Hercek <peter at syncad.com> wrote:
> 
>>Does the Window console API use some ANSI encoding for colors?
> 
> Afaik you have to use specific ioctl-like like calls. (They don't call
> it that way, of course).
> 
> Once I toyed with the ruby Windows api to see how console colors work,
> here is a two-line excerpt to get the feeling:
> 
> outh = Win32::Console::API.GetStdHandle(STD_OUTPUT_HANDLE)
> Win32::Console::API.SetConsoleTextAttribute(
>   outh, FOREGROUND_RED | FOREGROUND_INTENSITY
> )
> 
> It seems to be tedious but straightforward to use.
> 
> Maybe preprocessor macros could be used in a way such that a macro would
> be defined which either outputs the ansi escape sequence or makes the
> appropriate call to the Windows console api, depending on the platform.
> 

what about unix-like terms on windows (cygwin and co) that understand ansi?




More information about the darcs-users mailing list