Increase poll timeout

Ref: https://github.com/sayanarijit/xplr/issues/10
pull/268/head
Arijit Basu 3 years ago committed by Arijit Basu
parent ed65d85568
commit b61bf9dcf2

@ -15,9 +15,10 @@ pub fn keep_reading(tx_msg_in: Sender<Task>, rx_event_reader: Receiver<bool>) {
if is_paused {
thread::sleep(std::time::Duration::from_millis(200));
} else if event::poll(std::time::Duration::from_millis(50)).unwrap_or_default() {
} else if event::poll(std::time::Duration::from_millis(150)).unwrap_or_default() {
// NOTE: The poll timeout need to stay low, else spawning sub subshell
// and start typing immediately will cause panic.
// To reproduce, press `:`, then press and hold `!`.
match event::read() {
Ok(Event::Key(key)) => {
let key = Key::from_event(key);

@ -164,7 +164,10 @@ impl Runner {
let session_path = app.session_path().to_owned();
term::enable_raw_mode()?;
// Use a tty to enable piping results
let mut stdout = get_tty()?;
// let stdout = io::stdout();
// let mut stdout = stdout.lock();
execute!(stdout, term::EnterAlternateScreen)?;

Loading…
Cancel
Save