@@ -471,7 +471,17 @@ impl Application {
471471 }
472472 }
473473 signal::SIGCONT => {
474− self.claim_term().await.unwrap();
474+ // Copy/Paste from same issue from neovim:
475+ // https://github.com/neovim/neovim/issues/12322
476+ // https://github.com/neovim/neovim/pull/13084
477+ for retries in 1..=10 {
478+ match self.claim_term().await {
479+ Ok(()) => break,
480+ Err(err) if retries == 10 => panic!("Failed to claim terminal: {}", err),
481+ Err(_) => continue,
482+ }
483+ }
484+
475485 // redraw the terminal
476486 let area = self.terminal.size().expect("couldn't get terminal size");
477487 self.compositor.resize(area);