Skip to content

Commit

Permalink
Don't touch output config attributes in read_single_key() (#165)
Browse files Browse the repository at this point in the history
Raw mode also disables output processing, breaking terminal writes from separate threads.
  • Loading branch information
goodartistscopy committed May 21, 2023
1 parent b5c80cc commit bda931c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/unix_term.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ pub fn read_single_key() -> io::Result<Key> {
let mut termios = unsafe { termios.assume_init() };
let original = termios;
unsafe { libc::cfmakeraw(&mut termios) };
termios.c_oflag = original.c_oflag;
c_result(|| unsafe { libc::tcsetattr(fd, libc::TCSADRAIN, &termios) })?;

let rv: io::Result<Key> = loop {
Expand Down

0 comments on commit bda931c

Please sign in to comment.