diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/mod.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/client/mod.rs b/src/client/mod.rs index 6be41c06..52fd6dd6 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -1225,11 +1225,14 @@ fn run_client_with_mode( let should_quit = Arc::new(AtomicBool::new(false)); - // Install Ctrl+C handler. + // ctrlc's "termination" feature also catches SIGTERM/SIGHUP so direct + // termination signals still run the quit path and TerminalGuard::Drop. let quit_flag = should_quit.clone(); - let _ = ctrlc::set_handler(move || { + if let Err(err) = ctrlc::set_handler(move || { quit_flag.store(true, Ordering::Release); - }); + }) { + warn!(%err, "failed to install termination handler; terminal restore relies on TerminalGuard::Drop and the panic hook"); + } let result = rt.block_on(async { run_client_loop( |
