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:
1 parent
0bb3714435
commit
cc0d2e5493
1 file changed
+6
@@ -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(),
|
||||
|
||||
Reference in new issue
Block a user