fansi icon indicating copy to clipboard operation
fansi copied to clipboard

Colour leakage on Windows CMD & Cygwin

Open ssanj opened this issue 8 years ago • 2 comments

Hey,

I'm not sure if fansi supports Windows at the moment. I have seen colours leaking in both Windows 7 CMD and Cygwin.

Issuing the command:

fansi.Color.Red("Hello World Ansi!")

produces:

image

and I have to manually reset the colours back.

I have tested this on MacOSX and it's not an issue:

image

ssanj avatar Jun 01 '16 12:06 ssanj

Seems like the ansi reset-color-only code \u001b[39m doesn't work in cmd/cygwin?

What else doesn't work? Does it leak e.g. underlines or reversed? Those also currently translate to reset-X-only codes.

lihaoyi avatar Jun 04 '16 10:06 lihaoyi

BTW, has anybody looked at jansi or lanterna libs? It has windows support. Moreover, it has bindings to Win API like GetConsoleScreenBufferInfo, which can be used as a replacement to direct stty-usage (who needs a /dev/tty, which is absent on Windows).

iharh avatar Dec 15 '16 17:12 iharh