Home » Questions » Computers [ Ask a new question ]

PowerShell not displaying Unix colors

PowerShell not displaying Unix colors

I use various Linux programs on my Windows machine; some of them have colorized output. GnuWin32 and so forth.

Asked by: Guest | Views: 199
Total answers/comments: 3
Guest [Entry]

"Powershell is just a text-mode program, running in the Windows console. The Windows console does not support ANSI escape sequences which is what you are seeing.

To fix it, it depends a lot on which program you are using. I am guessing you use cygwin to run these scripts?"
Guest [Entry]

"For posterity

You can use ANSICON to display ANSI escape sequences in Windows consoles, including Powershell. This should give you color.

This issue thread on getting it to work with PowerShell has a few different solutions as there is more than one way to do it."
Guest [Entry]

"You said you were using Mercurial to run the Linux programs. Assuming you're referring to the source control system (which I didn't realize could run Linux programs; I only use it for source control), there's an extension that will let you show color. Wincolor will intercept the ANSI color control and call the appropriate Windows functions. It seems to work no matter what, but I think it works better with pyreadline installed.

Note: I have treid this without pyreadline, and it didn't work for me. I have not yet tried it with pyreadline."