[Windows] Improve console IO redirection.#91147
Conversation
|
So I didn't manage to export my game with this branch because I couldn't get the compiled mono assemblies to match up (presumably I would need to setup that local nuget repo that the docs mention, or somehow force the built Godot editor to use the dev.5 sdk version suffix), but I did get so far as to see that my game now outputs |
akien-mga
left a comment
There was a problem hiding this comment.
Looks good. Thanks for the overview of what works for each build type.
Do we still need the console wrapper after all this? If things like printing normal output to the host terminal works fine with the normal windows subsystem build, I feel like the console.exe might not add much value (but does add confusion for users on what it's for and whether to ship it).
|
Thanks! |
I would keep it since it's still a more convenient way to start the editor with console output from the UI. As well as providing a bit more consistent behavior than |
Improves console IO redirection and Unicode handling.
printto consoleprintto file/pipeget_stdin_stringfrom consoleget_stdin_stringfrom file/pipeprintf/std::coutto consoleprintf/std::coutto file/pipeprintf/std::coutin GDExtension to consoleprintf/std::coutin GDExtension to file/pipeConsole.WriteLineto consoleConsole.WriteLineto file/pipeGD.Printto consoleGD.Printto file/pipeUnicode characters seems to be working in all tested cases (both input and output), IO redirected to/from file/pipe expect and write text as UTF-8 without BOM (same as other platforms).
Note: using
>to redirect in PowerShell seems to be broken (not sure if it supposed to work), butStart-Process ... -RedirectStandardOutputworks fine. Incmd>and<works fine.Fixes #87591
Fixes #91002