Skip to content

Commit e7222eb

Browse files
author
Rafael Bachmann
committed
Fix 'double event' on windows crossterm read
1 parent cba16b6 commit e7222eb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

requestty-ui/src/events/crossterm.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ impl EventIterator for CrosstermEvents {
2121
fn next_event(&mut self) -> std::io::Result<super::KeyEvent> {
2222
loop {
2323
if let event::Event::Key(k) = event::read()? {
24-
if let Ok(k) = k.try_into() {
25-
return Ok(k);
24+
if k.is_press() || k.is_repeat() {
25+
if let Ok(k) = k.try_into() {
26+
return Ok(k);
27+
}
2628
}
2729
}
2830
}

0 commit comments

Comments
 (0)