Skip to content

Commit bda931c

Browse files
Don't touch output config attributes in read_single_key() (#165)
Raw mode also disables output processing, breaking terminal writes from separate threads.
1 parent b5c80cc commit bda931c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/unix_term.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ pub fn read_single_key() -> io::Result<Key> {
220220
let mut termios = unsafe { termios.assume_init() };
221221
let original = termios;
222222
unsafe { libc::cfmakeraw(&mut termios) };
223+
termios.c_oflag = original.c_oflag;
223224
c_result(|| unsafe { libc::tcsetattr(fd, libc::TCSADRAIN, &termios) })?;
224225

225226
let rv: io::Result<Key> = loop {

0 commit comments

Comments
 (0)