Mercurial > vim
changeset 9381:c665cc3292e0 v7.4.1972
commit https://github.com/vim/vim/commit/40de45664c20e7ca46a28a3f472202f90e47f8bf
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jul 1 15:03:46 2016 +0200
patch 7.4.1972
Problem: On Solaris select() does not work as expected when there is
typeahead.
Solution: Add ICANON when sleeping. (Ozaki Kiichi)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 01 Jul 2016 15:15:05 +0200 |
parents | a419e980f5b7 |
children | eb47189e7dd7 |
files | src/os_unix.c src/version.c |
diffstat | 2 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/os_unix.c +++ b/src/os_unix.c @@ -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) {