From 9c927538ad81a9253c43509bcb7479998a50b7fa Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 9 May 2020 12:30:51 +0200 Subject: [PATCH] Kernel: ioctl(TCSETSF) on a TTY should flush input This is where we end up when calling tcsetattr() with TCSAFLUSH. This fixes vttest not accepting the first keystroke as input. --- Kernel/TTY/TTY.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Kernel/TTY/TTY.cpp b/Kernel/TTY/TTY.cpp index 0ec94e2d70..f2215a7782 100644 --- a/Kernel/TTY/TTY.cpp +++ b/Kernel/TTY/TTY.cpp @@ -326,6 +326,8 @@ int TTY::ioctl(FileDescription&, unsigned request, unsigned arg) if (!process.validate_read(tp, sizeof(termios))) return -EFAULT; set_termios(*tp); + if (request == TCSETSF) + flush_input(); return 0; case TIOCGWINSZ: ws = reinterpret_cast(arg);