patch 7.4.1972
Problem:    On Solaris select() does not work as expected when there is
            typeahead.
Solution:   Add ICANON when sleeping. (Ozaki Kiichi)
diff --git a/src/os_unix.c b/src/os_unix.c
index f08adc5..32c1640 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -3411,7 +3411,13 @@
 	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)
     {