-
Notifications
You must be signed in to change notification settings - Fork 344
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
Fix Windows console setup so it works in an MSYS2 window. #882
Fix Windows console setup so it works in an MSYS2 window. #882
Conversation
Sorry for the delay, I assume this does not break the "native" terminal in Windows (cmd/powershell)? Will test on Windows a bit later today. |
Yes. I tested it with cmd and it works. That basically runs the path where the handles are not set and it has to use AttachConsole() to get them set. It seems like MSYS2 is the main case that actually sets the handles up front. The cmd.exe console uses the AttachConsole() path. Launching from File Explorer or the start menu trigger the AllocConsole() path. |
Great. Some more delays on my part I'm afraid. I use Will do so after work today, finally got some spare time this weekend that I can dedicate to Natron. |
Friendly ping. :) |
I'm really sorry, I totally forgot this. Will test after work today (I need to test a bunch of Windows stuff anyway). |
4a26a50
to
0f15835
Compare
This change adds checks to see if a console is already attached and avoids reopening stdout & stderr if so. This allows console logging to work properly in the typical MSYS2 bash window. For some reason the freopen() calls in the old code cause console printing to stop working.
0f15835
to
aca38bd
Compare
Friendly ping 2. FWIW I've been using this for months so I'm pretty sure it is safe. |
I'm sorry for not doing anything, too much other stuff in the way. I also don't have a free Windows PC to test Natron on anymore (can be fixed, but will probably take a week or two). So, I trust that you have tested this and will approve. |
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. Additionally, make sure you've done all of these things:
PR Description
What type of PR is this? (Check one of the boxes below)
What does this pull request do?
This change adds checks to see if a console is already attached and avoids reopening stdout & stderr if so. This allows console logging to work properly in the typical MSYS2 bash window. For some reason the freopen() calls in the old code cause console printing to stop working if a console was already attached (e.g. the MSYS2 bash window case).
Have you tested your changes (if applicable)? If so, how?
Yes. I've tested this by running Natron from a MSYS2 bash window, a normal Windows Command Prompt window, and launching Natron from the start menu with the "enable console windows" preference set. All of them now show the same logging info.
Futher details of this pull request
[Your answer]