Skip to content

Commit

Permalink
Increase poll timeout
Browse files Browse the repository at this point in the history
Ref: #10
  • Loading branch information
sayanarijit committed Jun 22, 2021
1 parent ed65d85 commit b61bf9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/event_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;

Expand Down

0 comments on commit b61bf9d

Please sign in to comment.