Skip to content

Instantly share code, notes, and snippets.

@ichizok
Created June 20, 2016 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ichizok/acae1b5431a639108dd8cf2768823dc2 to your computer and use it in GitHub Desktop.
Save ichizok/acae1b5431a639108dd8cf2768823dc2 to your computer and use it in GitHub Desktop.
diff --git a/src/os_unix.c b/src/os_unix.c
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -3411,7 +3411,11 @@ mch_settmode(int tmode)
tnew.c_cc[VTIME] = 0; /* don't wait */
}
else if (tmode == TMODE_SLEEP)
- tnew.c_lflag &= ~(ECHO);
+ {
+ 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)
{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment