Color in Windows CLI?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Spudster3@gmail.com

    #1

    Color in Windows CLI?

    Does anyone know how to make PHP display colors in the CLI (Command
    Line Interface)? I've tried almost everything including ANSI.SYS under
    command.exe. I would like to find a way to do it under cmd.exe, I know
    it will do colors under Linux in CLI using codes like "←[0;34mtest
    ←←[0m←" for Blue, but I need something to work under Windows.

    Thanks!

    Spudster

  • Chung Leong

    #2
    Re: Color in Windows CLI?


    Spudster3@gmail .com wrote:[color=blue]
    > Does anyone know how to make PHP display colors in the CLI (Command
    > Line Interface)? I've tried almost everything including ANSI.SYS under
    > command.exe. I would like to find a way to do it under cmd.exe, I know
    > it will do colors under Linux in CLI using codes like "←[0;34mtest
    > ←←[0m←" for Blue, but I need something to work under Windows.
    >
    > Thanks!
    >
    > Spudster[/color]

    If you can somehow get the Win32 module to work, the functions your
    need are GetStdHandle() and SetConsoleTextA ttribute(). Both are in
    kernel32.dll I believe.

    Comment

    Working...