- Making terminal input send after a certain number of characters
- stdbuf -i0 ./a.out
- #include <termios.h>
- main(){
- struct termios trm;
- tcgetattr(STDIN_FILENO, &trm); /* get the current settings */
- trm.c_cc[VMIN] = 1; /* return after 1 byte read; you might make this a 2*/
- trm.c_cc[VTIME] = 0; /* block forever until 1 byte is read */
- tcsetattr(STDIN_FILENO, TCSANOW, &trm);
- }