mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 09:54:10 +03:00
Fix info args not working with -console
The intention of the `-console` argument was to enable seeing console output on Windows without having to use workarounds. However, this didn't actually work for arguments like `-addresses` and `-version`, because the program would exit first before it could get the chance to create the console. The other issue is that the console closes too quickly before output can be read by the user. So to fix that, we must hold it open and let the user close it when they want to by waiting for an enter press from STDIN.
This commit is contained in:
@@ -220,6 +220,12 @@ void vlog_open_console(void)
|
||||
vlog_error("Could not redirect STDERR to console.");
|
||||
}
|
||||
|
||||
handle = freopen("CON", "r", stdin);
|
||||
if (handle == NULL)
|
||||
{
|
||||
vlog_error("Could not redirect STDIN to console.");
|
||||
}
|
||||
|
||||
check_color_support();
|
||||
|
||||
if (!SetConsoleOutputCP(CP_UTF8))
|
||||
|
||||
Reference in New Issue
Block a user