Skip to content

Commit

Permalink
Replace TCSAFLUSH by TCSADRAIN
Browse files Browse the repository at this point in the history
  • Loading branch information
gwenn committed Nov 11, 2016
1 parent 0dbb0a4 commit ef8d681
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tty/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ pub fn enable_raw_mode() -> Result<Mode> {
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(())
}

Expand Down

0 comments on commit ef8d681

Please sign in to comment.