init: set default termios on every username prompt

Before if e.g. Shell crashed init would have broken termios
This commit is contained in:
Bananymous 2023-11-30 22:39:53 +02:00
parent 9b841cb823
commit 6ccb1bbbf9
1 changed files with 6 additions and 0 deletions

View File

@ -8,6 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <termios.h>
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)