How to fix broken termios after top SIGQUIT - Wolframike/minishell GitHub Wiki

c_iflag

  • |= ICRNL

c_oflag

  • |= ONLCR

c_cflag

  • No change

c_lflag

  • |= (PENDIN | ICANON | ECHO)
  • &= ~NOFLSH

List of critical damage

ONCLR

Output display is corrupted without this flag

ECHO

Input does not show without this flag, resets when exiting shell

ICANON

Does not have any superficial effects

Example fix

termconf.c_lflag |= (PENDIN | ICANON | ECHO);
termconf.c_lflag &= ~NOFLSH;
termconf.c_iflag |= ICRNL;
termconf.c_oflag |= ONLCR;