- tcgetattr(G.kbd_fd, &G.term_orig);
- termbuf = G.term_orig;
- termbuf.c_iflag &= ~(BRKINT|INLCR|ICRNL|IXON|IXOFF|IUCLC|IXANY|IMAXBEL);
- //termbuf.c_oflag &= ~(OPOST); - no, we still want \n -> \r\n
- termbuf.c_lflag &= ~(ISIG|ICANON|ECHO);
- termbuf.c_cc[VMIN] = 1;
- termbuf.c_cc[VTIME] = 0;
- tcsetattr(G.kbd_fd, TCSANOW, &termbuf);
+
+ // All characters must be passed through to us unaltered
+ set_termios_to_raw(G.kbd_fd, &G.term_orig, 0
+ | TERMIOS_CLEAR_ISIG // no signals on ^C ^Z etc
+ | TERMIOS_RAW_INPUT // turn off all input conversions
+ );
+ //Note: termios.c_oflag &= ~(OPOST); - no, we still want \n -> \r\n