]> granicus.if.org Git - vim/commitdiff
patch 7.4.1972 v7.4.1972
authorBram Moolenaar <Bram@vim.org>
Fri, 1 Jul 2016 13:03:46 +0000 (15:03 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 1 Jul 2016 13:03:46 +0000 (15:03 +0200)
Problem:    On Solaris select() does not work as expected when there is
            typeahead.
Solution:   Add ICANON when sleeping. (Ozaki Kiichi)

src/os_unix.c
src/version.c

index f08adc58b1594362fa80a8952faafafc8b687c4c..32c1640f99768d1135305712406bcdfbc93ee38a 100644 (file)
@@ -3411,7 +3411,13 @@ mch_settmode(int tmode)
        tnew.c_cc[VTIME] = 0;           /* don't wait */
     }
     else if (tmode == TMODE_SLEEP)
-       tnew.c_lflag &= ~(ECHO);
+    {
+       /* Also reset ICANON here, otherwise on Solaris select() won't see
+        * typeahead characters. */
+       tnew.c_lflag &= ~(ICANON | ECHO);
+       tnew.c_cc[VMIN] = 1;            /* return after 1 char */
+       tnew.c_cc[VTIME] = 0;           /* don't wait */
+    }
 
 # if defined(HAVE_TERMIOS_H)
     {
index cfce606279adf2af83a10b0d61f0ff9b1c8af85b..2c6d8c4a6536880a06d5bab7a00de440612134c7 100644 (file)
@@ -753,6 +753,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1972,
 /**/
     1971,
 /**/