summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrabite <rabite@posteo.de>2019-05-21 23:29:57 +0200
committerrabite <rabite@posteo.de>2019-05-21 23:29:57 +0200
commit3a3827fe8185650f42d5ba445445e5d38fa13e10 (patch)
tree37fa3631ae3bab27f1b52afc09b451efd783c52c
parent96b7363fef9c7f18198be86fc36025a9f718202d (diff)
flush input before reading
-rw-r--r--src/widget.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widget.rs b/src/widget.rs
index 3ef7f76..1a91994 100644
--- a/src/widget.rs
+++ b/src/widget.rs
@@ -554,10 +554,10 @@ fn event_thread(rx_global: Receiver<Events>,
fn input_thread(tx: Sender<Events>, rx_input_request: Receiver<()>) {
std::thread::spawn(move || {
for input in stdin().events() {
- term::flush_stdin();
input.map(|input| {
tx.send(Events::InputEvent(input)).unwrap();
rx_input_request.recv().unwrap();
+ term::flush_stdin();
}).map_err(|e| HError::from(e)).log();
}
});