getch2: request at least 1 byte of input each read

fixes issue with | less, where mplayer broke less's terminal
expectations and made less quit

Note this means that read() will be blocking again. Should be ok, as we
always check via select() before reading.
This commit is contained in:
Rudolf Polzer 2012-09-17 11:12:51 +02:00 committed by wm4
parent 020a954b60
commit a70adbfe65
1 changed files with 1 additions and 1 deletions

View File

@ -292,7 +292,7 @@ static void do_enable_getch2(void)
struct termios tio_new;
tcgetattr(0,&tio_new);
tio_new.c_lflag &= ~(ICANON|ECHO); /* Clear ICANON and ECHO. */
tio_new.c_cc[VMIN] = 0;
tio_new.c_cc[VMIN] = 1;
tio_new.c_cc[VTIME] = 0;
tcsetattr(0,TCSANOW,&tio_new);
#endif