From b62c04849896838fdaefadaffced6fa81a93ac13 Mon Sep 17 00:00:00 2001 From: Max Wash Date: Tue, 19 Nov 2024 15:58:25 +0000 Subject: [PATCH] frontend: line-ed: fix control characters (\n, \r, etc) being mishandled on win32 --- frontend/sys/windows/line-ed/tty.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/sys/windows/line-ed/tty.c b/frontend/sys/windows/line-ed/tty.c index db55fe4..b4a17bb 100644 --- a/frontend/sys/windows/line-ed/tty.c +++ b/frontend/sys/windows/line-ed/tty.c @@ -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); }