https://bugs.winehq.org/show_bug.cgi?id=56597
Bug ID: 56597 Summary: Wine does not recognize ANSI escape codes Product: Wine Version: 9.7 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: ucrtbase Assignee: wine-bugs@winehq.org Reporter: wszqkzqk@qq.com Distribution: ---
Created attachment 76355 --> https://bugs.winehq.org/attachment.cgi?id=76355 binary file to reproduce
According to [Wikipedia](https://en.wikipedia.org/wiki/ANSI_escape_code#DOS_and_Windows) and [Windows API docs](https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-s...), Windows has supported ANSI escape code since Windows 10 version 1511.
```c #include <locale.h> #include <stdio.h>
int main () { setlocale (LC_ALL, ""); fprintf (stdout, "\x1b[32m" "\x1b[1m" "STDOUT" "\x1b[0m" "\n"); fprintf (stderr, "\x1b[31m" "\x1b[1m" "STDERR" "\x1b[0m" "\n"); } ```
For this example (compiled with clang 18 in msys2, linked to `ucrtbase.dll`), the characters can be escaped with color and bold and output as we expected under Windows. However, run these program in wine will directly print out the escape code without escaping:
``` [32m[1mSTDOUT[0m [31m[1mSTDERR[0m ```
https://bugs.winehq.org/show_bug.cgi?id=56597
wszqkzqk@qq.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |wszqkzqk@qq.com
https://bugs.winehq.org/show_bug.cgi?id=56597
Eric Pouech eric.pouech@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED CC| |eric.pouech@gmail.com Resolution|--- |DUPLICATE
--- Comment #1 from Eric Pouech eric.pouech@gmail.com --- Notes: - impacted component in programs/console - works fine in Unix console though
*** This bug has been marked as a duplicate of bug 52850 ***
https://bugs.winehq.org/show_bug.cgi?id=56597
--- Comment #2 from wszqkzqk@qq.com --- (In reply to Eric Pouech from comment #1)
Notes:
- impacted component in programs/console
- works fine in Unix console though
*** This bug has been marked as a duplicate of bug 52850 ***
It seems that this bug report includes more information than bug 52850, would it be better to move to here?
It's not an issue of wine console, I tried to run the attached example in KDE's konsole and it doesn't work. I think it's a bug of `ucrtbase.dll` that wine have not followed the changes of Windows in Windows 10 1511.
https://bugs.winehq.org/show_bug.cgi?id=56597
--- Comment #3 from Eric Pouech eric.pouech@gmail.com ---
It seems that this bug report includes more information than bug 52850, would it be better to move to here?
doesn't matter much... the issue is well known
It's not an issue of wine console, I tried to run the attached example in KDE's konsole and it doesn't work. I think it's a bug of `ucrtbase.dll` that wine have not followed the changes of Windows in Windows 10 1511.
I tested your recompiled C sample, with ucrtbase, on xfce console & xterm and it works as expected. what makes you think that ucrtbase is to blame?
https://bugs.winehq.org/show_bug.cgi?id=56597
--- Comment #4 from wszqkzqk@qq.com --- (In reply to Eric Pouech from comment #3)
It seems that this bug report includes more information than bug 52850, would it be better to move to here?
doesn't matter much... the issue is well known
It's not an issue of wine console, I tried to run the attached example in KDE's konsole and it doesn't work. I think it's a bug of `ucrtbase.dll` that wine have not followed the changes of Windows in Windows 10 1511.
I tested your recompiled C sample, with ucrtbase, on xfce console & xterm and it works as expected. what makes you think that ucrtbase is to blame?
Did you compile it with winegcc or mingw-w64?
https://bugs.winehq.org/show_bug.cgi?id=56597
--- Comment #5 from wszqkzqk@qq.com --- (In reply to Eric Pouech from comment #3)
what makes you think that ucrtbase is to blame?
????????????Maybe it's wrong.
I just infferred from the if you need to use ANSI escape code in old windows versions, you need to additionally call the Windows API, but after the Windows 10 1511 update, you no longer need to.
Now it looks like more verification is needed to figure it out.????
https://bugs.winehq.org/show_bug.cgi?id=56597
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #6 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Closing duplicate.