summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRudolf Polzer <divverent@xonotic.org>2012-09-17 11:12:51 +0200
committerwm4 <wm4@nowhere>2012-09-19 14:57:35 +0200
commita70adbfe655804008578c1a17ecddcd770e0cf7c (patch)
tree14e77443b0499dd909b7ad01ae889140ac7915e2
parent020a954b60fccb15711d8e5b26a71e54bc6050c7 (diff)
downloadmpv-a70adbfe655804008578c1a17ecddcd770e0cf7c.tar.bz2
mpv-a70adbfe655804008578c1a17ecddcd770e0cf7c.tar.xz
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.
-rw-r--r--osdep/getch2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/osdep/getch2.c b/osdep/getch2.c
index cd8a198737..6b41514a9e 100644
--- a/osdep/getch2.c
+++ b/osdep/getch2.c
@@ -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