From a4a2b2f1dedb44cff6ee9b35a8978b6bc5dcff53 Mon Sep 17 00:00:00 2001 From: lethosor Date: Sun, 19 Apr 2015 11:58:35 -0400 Subject: [PATCH] Use TCSADRAIN instead of TCSAFLUSH when initializing raw mode --- NEWS | 1 + library/Console-posix.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 43ae5e926..35e0a0cee 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ DFHack Future Internals A method for caching screen output is now available to Lua (and C++) Developer plugins can be ignored on startup by setting the DFHACK_NO_DEV_PLUGINS environment variable + The console on Linux and OS X now recognizes keyboard input between prompts Lua New internal commands New plugins diff --git a/library/Console-posix.cpp b/library/Console-posix.cpp index 21093dff3..90086874b 100644 --- a/library/Console-posix.cpp +++ b/library/Console-posix.cpp @@ -397,7 +397,7 @@ namespace DFHack // We want read to return every single byte, without timeout. raw.c_cc[VMIN] = 1; raw.c_cc[VTIME] = 0;// 1 byte, no timer // put terminal in raw mode after flushing - if (tcsetattr(STDIN_FILENO,TCSAFLUSH,&raw) < 0) + if (tcsetattr(STDIN_FILENO,TCSADRAIN,&raw) < 0) return -1; rawmode = 1; return 0;