Increase poll timeout

Ref: https://github.com/sayanarijit/xplr/issues/10
This commit is contained in:
Arijit Basu 2021-06-22 09:02:29 +05:30 committed by Arijit Basu
parent ed65d85568
commit b61bf9dcf2
2 changed files with 5 additions and 1 deletions

View File

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

View File

@ -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)?;