mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04:00
Fix crash on opening from suspend state (#6764)
* Fix crash on opening from suspend state (#6725) * Fix code style * revert using of the imperative code style. Add panic if couldn't set terminal raw mode * remove redundant import of core::panic macros * small refactoring
This commit is contained in:
parent
7706ff77eb
commit
1b016a89d5
@ -471,7 +471,17 @@ pub async fn handle_signals(&mut self, signal: i32) {
|
||||
}
|
||||
}
|
||||
signal::SIGCONT => {
|
||||
self.claim_term().await.unwrap();
|
||||
// Copy/Paste from same issue from neovim:
|
||||
// https://github.com/neovim/neovim/issues/12322
|
||||
// https://github.com/neovim/neovim/pull/13084
|
||||
for retries in 1..=10 {
|
||||
match self.claim_term().await {
|
||||
Ok(()) => break,
|
||||
Err(err) if retries == 10 => panic!("Failed to claim terminal: {}", err),
|
||||
Err(_) => continue,
|
||||
}
|
||||
}
|
||||
|
||||
// redraw the terminal
|
||||
let area = self.terminal.size().expect("couldn't get terminal size");
|
||||
self.compositor.resize(area);
|
||||
|
Loading…
Reference in New Issue
Block a user