#include <termios.h> #include <stdio.h> main () { struct termios tio; tcgetattr(0, &tio); tio.c_cc[VMIN] = 1; tio.c_cc[VTIME] = 0; tio.c_lflag &= ~ICANON; tcsetattr(0, TCSANOW, &tio); }