termwiz: fixup key_tester example on macOS

We need to set the terminal to blocking mode when we want poll_input
to block forever, otherwise we immediately receive WouldBlock error
response and quit the program.
This commit is contained in:
Wez Furlong committed 2019-05-26 19:01:03 -07:00
1 parent 0bb3714435
commit cc0d2e5493
1 file changed
+6
+6
View File
@@ -449,6 +449,12 @@ impl Terminal for UnixTerminal {
},
];
self.read.set_blocking(if wait.is_none() {
Blocking::Wait
} else {
Blocking::DoNotWait
})?;
let poll_result = unsafe {
poll(
pfd.as_mut_ptr(),