POV-Ray : Newsgroups : povray.off-topic : Colour consoles Server Time
7 Sep 2024 09:23:31 EDT (-0400)
  Colour consoles (Message 14 to 23 of 33)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Fredrik Eriksson
Subject: Re: Colour consoles
Date: 20 Aug 2008 11:55:21
Message: <op.uf6zuilk7bxctx@e6600>
On Wed, 20 Aug 2008 17:50:46 +0200, Invisible <voi### [at] devnull> wrote:
> I've tried things like this several times before, and it's never worked  
> for me...

As I said before, only 16-bit applications can use colour escapes under NT.


-- 
FE


Post a reply to this message

From: Jim Holsenback
Subject: Re: Colour consoles
Date: 20 Aug 2008 12:01:37
Message: <48ac3fe1@news.povray.org>
"Invisible" <voi### [at] devnull> wrote in message 
news:48ac3d56$1@news.povray.org...
>>>> NT-based console windows do not support colour escape codes. Only 
>>>> 16-bit applications (running under NTVDM) can use colour escapes.
>>>
>>> So this doesn't work?
>>>
>>>
http://www.windowsnetworking.com/kbase/WindowsTips/Windows2000/UserTips/Miscellaneous/CommandInterpreterAnsiSupport.html
>>
>> "the command.com shell interpreter"
>>
>> "Any DOS applications you run in this command shell will now have ANSI 
>> support."
>
> I've tried things like this several times before, and it's never worked 
> for me...

I run ksh on my windows xp machine and I'm able to do all that with just a 
few escape sequences in my .profile

Jim


Post a reply to this message

From: Darren New
Subject: Re: Colour consoles
Date: 20 Aug 2008 12:07:12
Message: <48ac4130@news.povray.org>
Invisible wrote:
> I cannot for the life of me figure out how to get at 
> symbolic constant names. :-(

Technically, there's no such thing in C as such. The #define substitutes 
the actual value for the name before the "compiler proper" ever sees it.

That's why the C standard requires something like
   f(3 + 2);
to not do any additions before invoking f(5). Otherwise, people would 
hesitate to use something like
#define LAST (PREV+1)


-- 
Darren New / San Diego, CA, USA (PST)


Post a reply to this message

From: Darren New
Subject: Re: Colour consoles
Date: 20 Aug 2008 12:08:05
Message: <48ac4165@news.povray.org>
Fredrik Eriksson wrote:
> On Wed, 20 Aug 2008 17:43:05 +0200, Darren New <dne### [at] sanrrcom> wrote:
>> Fredrik Eriksson wrote:
>>> NT-based console windows do not support colour escape codes. Only 
>>> 16-bit applications (running under NTVDM) can use colour escapes.
>>
>> So this doesn't work?
>>
>>
http://www.windowsnetworking.com/kbase/WindowsTips/Windows2000/UserTips/Miscellaneous/CommandInterpreterAnsiSupport.html

>>
> 
> "the command.com shell interpreter"
> 
> "Any DOS applications you run in this command shell will now have ANSI 
> support."

Oh. OK. So you can't invoke it from command.com and have it work?

-- 
Darren New / San Diego, CA, USA (PST)


Post a reply to this message

From: Fredrik Eriksson
Subject: Re: Colour consoles
Date: 20 Aug 2008 12:24:51
Message: <op.uf607owp7bxctx@e6600>
On Wed, 20 Aug 2008 18:08:05 +0200, Darren New <dne### [at] sanrrcom> wrote:
> Oh. OK. So you can't invoke it from command.com and have it work?

Only if it is a 16-bit application. The colour escape functionality is  
provided by 'ansi.sys' which is a 16-bit driver.


-- 
FE


Post a reply to this message

From: Mike Raiford
Subject: Re: Colour consoles
Date: 20 Aug 2008 13:42:18
Message: <48ac577a$1@news.povray.org>
Invisible wrote:

> I wonder... Is there some function call in the Win32 API that can 
> actually change the colour of the text in a console window? Or is that 
> impossible? Does anybody here know the Win32 API well enough to know the 
> answer?

Yes, there is:

#include "stdio.h"
#include "windows.h"

void main()
{
     HANDLE hCon = GetStdHandle(STD_OUTPUT_HANDLE);
     SetConsoleTextAttribute(hCon, 0x0C);
     printf("Hello in red");
     SetConsoleTextAttribute(hCon, 0x09);
     printf(" and in blue\n");
     getchar();
}

Detailed here:
http://msdn.microsoft.com/en-us/library/ms686047.aspx


Post a reply to this message

From: Warp
Subject: Re: Colour consoles
Date: 20 Aug 2008 15:22:28
Message: <48ac6ef4@news.povray.org>
Invisible <voi### [at] devnull> wrote:
> You *know* something's wrong when you find yourself envying people who 
> use Unix because it can emulate an obsolete VT100... o_O

> Basically, I have a perfectly working console application, but I wish I 
> could just make certain parts of its output come out in a different 
> colour. On Unix, this would be a fairly trivial matter of writing some 
> escape codes to stdout and you're done.

  AFAIK, the VT100 didn't support colors. That came with later versions
of VT.

-- 
                                                          - Warp


Post a reply to this message

From: Jim Henderson
Subject: Re: Colour consoles
Date: 20 Aug 2008 18:34:52
Message: <48ac9c0c$1@news.povray.org>
On Wed, 20 Aug 2008 16:42:13 +0100, Invisible wrote:

> I meant how to get that stuff into Haskell.

Oh, I see....

Jim


Post a reply to this message

From: Invisible
Subject: Re: Colour consoles
Date: 21 Aug 2008 03:49:21
Message: <48ad1e01@news.povray.org>
Mike Raiford wrote:

> Yes, there is:
> 
> #include "stdio.h"
> #include "windows.h"
> 
> void main()
> {
>     HANDLE hCon = GetStdHandle(STD_OUTPUT_HANDLE);
>     SetConsoleTextAttribute(hCon, 0x0C);
>     printf("Hello in red");
>     SetConsoleTextAttribute(hCon, 0x09);
>     printf(" and in blue\n");
>     getchar();
> }
> 
> Detailed here:
> http://msdn.microsoft.com/en-us/library/ms686047.aspx

Yah, that works.

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Invisible
Subject: Re: Colour consoles
Date: 21 Aug 2008 03:54:45
Message: <48ad1f45$1@news.povray.org>
Warp wrote:

>   AFAIK, the VT100 didn't support colors. That came with later versions
> of VT.

Rather alarmingly, you're right again...

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.