flush input before reading

This commit is contained in:
rabite 2019-05-21 23:29:57 +02:00
parent 96b7363fef
commit 3a3827fe81
1 changed files with 1 additions and 1 deletions

View File

@ -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();
}
});