From 6ccb1bbbf9dc6dce64f22ec201658163c908f50f Mon Sep 17 00:00:00 2001 From: Bananymous Date: Thu, 30 Nov 2023 22:39:53 +0200 Subject: [PATCH] init: set default termios on every username prompt Before if e.g. Shell crashed init would have broken termios --- userspace/init/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/userspace/init/main.cpp b/userspace/init/main.cpp index 72523928..c1acf03f 100644 --- a/userspace/init/main.cpp +++ b/userspace/init/main.cpp @@ -8,6 +8,7 @@ #include #include #include +#include void initialize_stdio() { @@ -26,8 +27,13 @@ int main() bool first = true; + termios termios; + tcgetattr(STDIN_FILENO, &termios); + while (true) { + tcsetattr(STDIN_FILENO, TCSANOW, &termios); + char name_buffer[128]; while (!first)