fix ioctl:set-cbreak and ioctl:set-lbreak

FossilOrigin-Name: 1d887d0b60e0d6f9455e2889c961288d3887f98f7c6b548a5cc5255d255463dd
This commit is contained in:
crc 2024-01-23 02:28:03 +00:00
parent 3cbe04ce03
commit 9ed5d12c71

View file

@ -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);
}