diff --git a/library/Console-posix.cpp b/library/Console-posix.cpp index c3bb92dbd..8ef879d48 100644 --- a/library/Console-posix.cpp +++ b/library/Console-posix.cpp @@ -396,8 +396,8 @@ namespace DFHack // control chars - set return condition: min number of bytes and timer. // 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,TCSADRAIN,&raw) < 0) + // put terminal in raw mode + if (tcsetattr(STDIN_FILENO, TCSADRAIN, &raw) < 0) return -1; rawmode = 1; return 0; @@ -406,7 +406,7 @@ namespace DFHack void disable_raw() { /* Don't even check the return value as it's too late. */ - if (rawmode && tcsetattr(STDIN_FILENO,TCSAFLUSH,&orig_termios) != -1) + if (rawmode && tcsetattr(STDIN_FILENO, TCSADRAIN, &orig_termios) != -1) rawmode = 0; } void prompt_refresh()