From fa297b31c04ee1c1b2f26b3b4ebca8d4b533899e Mon Sep 17 00:00:00 2001 From: sxyazi Date: Fri, 19 Jul 2024 01:46:03 +0800 Subject: [PATCH] fix: destroy term before stopping signals --- yazi-fm/src/app/commands/stop.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/yazi-fm/src/app/commands/stop.rs b/yazi-fm/src/app/commands/stop.rs index 041bb86a..436eec52 100644 --- a/yazi-fm/src/app/commands/stop.rs +++ b/yazi-fm/src/app/commands/stop.rs @@ -15,7 +15,11 @@ impl App { pub(crate) fn stop(&mut self, opt: impl Into) { self.cx.manager.active_mut().preview.reset_image(); - self.signals.stop(opt.into().tx); + // We need to destroy the `term` first before stopping the `signals` + // to prevent any signal from triggering the term to render again + // while the app is being suspended. self.term = None; + + self.signals.stop(opt.into().tx); } }