Fix newlines not honored in Windows console

This is relevant when building with `windows_subsystem=console`.

(cherry picked from commit e14c5186e2)
This commit is contained in:
Pedro J. Estébanez 2022-10-11 10:09:36 +02:00 committed by Haoyu Qiu
parent 2ead966f87
commit 0e0550a83a

View file

@ -3950,6 +3950,10 @@ OS_Windows::OS_Windows(HINSTANCE _hInstance) {
AudioDriverManager::add_driver(&driver_xaudio2);
#endif
HANDLE stdoutHandle = GetStdHandle(STD_OUTPUT_HANDLE);
DWORD outMode = ENABLE_PROCESSED_OUTPUT;
SetConsoleMode(stdoutHandle, outMode);
Vector<Logger *> loggers;
loggers.push_back(memnew(WindowsTerminalLogger));
_set_logger(memnew(CompositeLogger(loggers)));