fix: uv_tty_set_mode failed in Windows #22264

Problem:  uv_tty_set_mode on stdout in Windows exits with error.
Cause:    Windows cannot set the properties of the output of a tty.
Solution: Remove call to uv_tty_set_mode.

Ref: #21445
Ref: 88634c1405 (r100598822)
This commit is contained in:
Enan Ajmain
2023-02-15 01:15:28 +06:00
committed by GitHub
parent b4a92309f8
commit e03ecb7d31

View File

@@ -359,12 +359,7 @@ static void terminfo_start(TUIData *tui)
if (ret) { if (ret) {
ELOG("uv_tty_init failed: %s", uv_strerror(ret)); ELOG("uv_tty_init failed: %s", uv_strerror(ret));
} }
#ifdef MSWIN #ifndef MSWIN
ret = uv_tty_set_mode(&tui->output_handle.tty, UV_TTY_MODE_RAW);
if (ret) {
ELOG("uv_tty_set_mode failed: %s", uv_strerror(ret));
}
#else
int retry_count = 10; int retry_count = 10;
// A signal may cause uv_tty_set_mode() to fail (e.g., SIGCONT). Retry a // A signal may cause uv_tty_set_mode() to fail (e.g., SIGCONT). Retry a
// few times. #12322 // few times. #12322