mirror of
https://github.com/wez/wezterm.git
synced 2024-11-27 12:23:46 +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:
parent
0bb3714435
commit
cc0d2e5493
@ -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(),
|
||||
|
Loading…
Reference in New Issue
Block a user