termwiz: avoid emitting a wake event on a spurious pipe wakeup
This commit is contained in:
1 parent
ae303fea56
commit
c0e3bdfb70
1 file changed
+4
-2
@@ -457,8 +457,10 @@ impl Terminal for UnixTerminal {
|
||||
|
||||
if pfd[2].revents != 0 {
|
||||
let mut buf = [0u8; 64];
|
||||
if self.wake_pipe.read(&mut buf).is_ok() {
|
||||
return Ok(Some(InputEvent::Wake));
|
||||
if let Ok(n) = self.wake_pipe.read(&mut buf) {
|
||||
if n > 0 {
|
||||
return Ok(Some(InputEvent::Wake));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user