frontend: line-ed: fix control characters (\n, \r, etc) being mishandled on win32

This commit is contained in:
2024-11-19 15:58:25 +00:00
parent 1dbe68cfeb
commit b62c048498

View File

@@ -113,11 +113,12 @@ bool s_tty_is_interactive(const struct s_tty *tty)
void s_tty_set_raw(struct s_tty *tty)
{
DWORD mode = tty->t_canon_mode_in;
mode &= ~(ENABLE_ECHO_INPUT | ENABLE_INSERT_MODE | ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT | ENABLE_QUICK_EDIT_MODE | ENABLE_WINDOW_INPUT);
mode &= ~(ENABLE_ECHO_INPUT | ENABLE_INSERT_MODE | ENABLE_LINE_INPUT | ENABLE_QUICK_EDIT_MODE | ENABLE_WINDOW_INPUT);
mode |= (ENABLE_PROCESSED_INPUT);
SetConsoleMode(tty->t_in, mode);
mode = tty->t_canon_mode_out;
mode &= ~(ENABLE_PROCESSED_OUTPUT);
//mode &= ~(ENABLE_PROCESSED_OUTPUT);
SetConsoleMode(tty->t_out, mode);
}