-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mingw-w64-x86_64-gcc's output is not highlighted #14087
Comments
Can you provide any example or steps to reproduce your issue? Sometimes, uncolored output is an expected behavior. |
It's always uncolored when using on the Mintty terminal. You can reproduce it by compiling any source code that trigger warnings when compiling. In my case it's CopperSpice. Update: if CopperSpice is too big, this is a more lightweight codebase to reproduce the problem: https://github.com/brwhale/KataScript |
Which Windows version? Is you MSYS2 install up-to-date? |
Windows 8.1 64 bit. My MSYS2 is up-to-date. |
does copperspice use msys make or meson/ninja i noticed make correctly highlights the output when msys make is used and colormake is installed but meson and ninja builds are allways mono colored. |
I think the cygwin pipe name patch was never updated for the new (pipe) naming: https://github.com/msys2/MINGW-packages/blob/ec4adeaf30323d25f694c51c729bd288e4f9b002/mingw-w64-gcc/0140-gcc-8.2.0-diagnostic-color.patch |
whoops x-) |
Try to add |
Yes that works, but I'd prefer not having to explicitly set that flag |
@lazka Is that patch required now? I have created a small program with that patch's code. Using STD_ERROR_HANDLE as handle, the OBJECT_NAME_INFORMATION::Name.Buffer returns
In the gcc code, the return value of GetConsoleMode is checked. That check will return true because the std i/o handles are now console handles by default (case 1). |
If I understand it correctly this is only the case for Win10 and newer. I tried the code on Win7 and I know Win7 isn't supported anymore, but at least Win8 might have the same behavior. |
You are correct, Windows 7 does not have ConPTY feature. So, the standard handles are pipes. If we consider all supported Windows versions the 0140-gcc-8.2.0-diagnostic-color.patch has to also check for Windows version + \Device\ConDrv cases. |
Assuming Anyway, I updated the patch to check for I also tried to hack the binary by forcing the check to always return true, but for some reason it didn't have any effect (and I'm pretty sure I modified the correct function). But maybe I overlooked something, so I'm hoping this small adjustment to the patch will suffice. |
I have tested a version compiled with the above patch and can confirm that the output is coloured again on Win7 without having to force it. Though maybe checking instead for just |
Windows 7 support has been discontinued https://www.msys2.org/news/#2023-01-15-dropping-support-for-windows-7-and-80. The 0140-gcc-8.2.0-diagnostic-color.patch is no longer required and can be removed. |
(Windows 8.1 would still require it) |
Unfortunately I only have a Win7 system available for mingw testing, maybe someone with a Win8.1/Win10 can give some feedback what the current behavior is? |
Only when using the Mintty terminal by the MSYS2 MINGW64 shortcut. If using Windows Command Prompt (adding C:\msys64\mingw64\bin to PATH) then it's correctly highlighted. How could I have it correctly highlighted with the Mintty terminal? Thanks.
The text was updated successfully, but these errors were encountered: