From 9ed5d12c7114436a52e2bf126e3ab8d4e4d73aa0 Mon Sep 17 00:00:00 2001 From: crc <> Date: Tue, 23 Jan 2024 02:28:03 +0000 Subject: [PATCH] fix ioctl:set-cbreak and ioctl:set-lbreak FossilOrigin-Name: 1d887d0b60e0d6f9455e2889c961288d3887f98f7c6b548a5cc5255d255463dd --- vm/nga-c/dev-ioctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vm/nga-c/dev-ioctl.c b/vm/nga-c/dev-ioctl.c index 7e159ca..1acdd50 100644 --- a/vm/nga-c/dev-ioctl.c +++ b/vm/nga-c/dev-ioctl.c @@ -25,7 +25,7 @@ void ioctl_get_terminal_size(NgaState *vm) { void ioctl_set_character_breaking_mode(NgaState *vm) { struct termios term; tcgetattr(STDIN_FILENO, &term); - term.c_iflag |= BRKINT; + term.c_lflag &=(~ICANON & ECHO); tcsetattr(STDIN_FILENO, TCSANOW, &term); } @@ -33,6 +33,7 @@ void ioctl_set_line_buffered_mode(NgaState *vm) { struct termios term; tcgetattr(STDIN_FILENO, &term); term.c_lflag |= ICANON; + term.c_lflag |= ECHO; tcsetattr(STDIN_FILENO, TCSANOW, &term); }