1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Combine existing modes when calling SetConsoleMode

Otherwise the default modes will be cleared, which causes long lines to
be truncated in some terminals (e.g. Windows Terminal).
This commit is contained in:
Alvin Wong
2024-07-28 00:29:52 +08:00
parent 607b230ffe
commit 28c60a5ff9
2 changed files with 6 additions and 2 deletions

View File

@@ -65,7 +65,9 @@ int main(int argc, char *argv[]) {
// Enable virtual terminal sequences processing.
HANDLE stdout_handle = GetStdHandle(STD_OUTPUT_HANDLE);
DWORD out_mode = ENABLE_PROCESSED_OUTPUT | ENABLE_VIRTUAL_TERMINAL_PROCESSING;
DWORD out_mode = 0;
GetConsoleMode(stdout_handle, &out_mode);
out_mode |= ENABLE_PROCESSED_OUTPUT | ENABLE_VIRTUAL_TERMINAL_PROCESSING;
SetConsoleMode(stdout_handle, out_mode);
// Find main executable name and check if it exist.