From 9ef96899eddacfd2d7d42525d759567632332a8b Mon Sep 17 00:00:00 2001 From: gwenn Date: Fri, 11 Nov 2016 11:01:36 +0100 Subject: [PATCH] Replace TCSAFLUSH by TCSADRAIN See https://github.com/antirez/linenoise/issues/75 --- src/tty/unix.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tty/unix.rs b/src/tty/unix.rs index dad14a848d..1feb474243 100644 --- a/src/tty/unix.rs +++ b/src/tty/unix.rs @@ -106,13 +106,13 @@ pub fn enable_raw_mode() -> Result { raw.c_lflag = raw.c_lflag & !(ECHO | ICANON | IEXTEN | ISIG); raw.c_cc[VMIN] = 1; // One character-at-a-time input raw.c_cc[VTIME] = 0; // with blocking read - try!(termios::tcsetattr(STDIN_FILENO, termios::TCSAFLUSH, &raw)); + try!(termios::tcsetattr(STDIN_FILENO, termios::TCSADRAIN, &raw)); Ok(original_mode) } /// Disable RAW mode for the terminal. pub fn disable_raw_mode(original_mode: Mode) -> Result<()> { - try!(termios::tcsetattr(STDIN_FILENO, termios::TCSAFLUSH, &original_mode)); + try!(termios::tcsetattr(STDIN_FILENO, termios::TCSADRAIN, &original_mode)); Ok(()) }