ECHOERR and color escape sequences

May 20, 2008
12,049
128
Syracuse, NY, USA
Why doesn't this work?

1615830998214.png


This works.

1615831028955.png
 
May 20, 2008
12,049
128
Syracuse, NY, USA
Ask Microsoft; they handle ANSI in Win 10. Apparently they don't want you to use ANSI for STDERR.
I dunno! Both of these work.

Code:
    fwprintf(stderr, L"\x01b[31;1mfoo\x01b[0m\n");
    WriteConsoleW(GetStdHandle(STD_ERROR_HANDLE), L"\x01b[31;1mfoo\x01b[0m\n", 15, NULL, NULL);
 

Similar threads