mirror of https://github.com/bobwen-dev/hunter
flush input before reading
This commit is contained in:
parent
96b7363fef
commit
3a3827fe81
|
@ -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();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue