This commit is contained in:
asctime 2023-08-02 01:46:41 -04:00 committed by GitHub
commit 455b8d58b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -713,7 +713,11 @@ void console_init(console_state & con_st) {
HANDLE hConIn = GetStdHandle(STD_INPUT_HANDLE); HANDLE hConIn = GetStdHandle(STD_INPUT_HANDLE);
if (hConIn != INVALID_HANDLE_VALUE && GetConsoleMode(hConIn, &dwMode)) { if (hConIn != INVALID_HANDLE_VALUE && GetConsoleMode(hConIn, &dwMode)) {
// Set console input codepage to UTF16 // Set console input codepage to UTF16
#ifdef __MINGW32__ /* UTF16 requires wmain in MinGW */
_setmode(_fileno(stdin), _O_TEXT);
#else
_setmode(_fileno(stdin), _O_WTEXT); _setmode(_fileno(stdin), _O_WTEXT);
#endif
// Turn off ICANON (ENABLE_LINE_INPUT) and ECHO (ENABLE_ECHO_INPUT) // Turn off ICANON (ENABLE_LINE_INPUT) and ECHO (ENABLE_ECHO_INPUT)
dwMode &= ~(ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT); dwMode &= ~(ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT);