1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-30 14:49:26 +03:00

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 2019-05-26 19:01:03 -07:00
parent 0bb3714435
commit cc0d2e5493

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 { let poll_result = unsafe {
poll( poll(
pfd.as_mut_ptr(), pfd.as_mut_ptr(),