[Bug 56597] New: Wine does not recognize ANSI escape codes
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(a)winehq.org Reporter: wszqkzqk(a)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 ``` -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=56597 wszqkzqk(a)qq.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wszqkzqk(a)qq.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=56597 Eric Pouech <eric.pouech(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED CC| |eric.pouech(a)gmail.com Resolution|--- |DUPLICATE --- Comment #1 from Eric Pouech <eric.pouech(a)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 *** -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=56597 --- Comment #2 from wszqkzqk(a)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. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=56597 --- Comment #3 from Eric Pouech <eric.pouech(a)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?
-- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=56597 --- Comment #4 from wszqkzqk(a)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? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=56597 --- Comment #5 from wszqkzqk(a)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.???? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=56597 Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #6 from Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> --- Closing duplicate. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla