From cf666fd6bfc4118061cb759207337a2ed0e71f0f Mon Sep 17 00:00:00 2001 From: sxyazi Date: Sun, 10 Mar 2024 19:00:30 +0800 Subject: [PATCH] fix: respond to the `SIGTERM` signal even when Yazi is in the background and has passed control of the terminal to the spawned process --- .github/ISSUE_TEMPLATE/bug.yml | 4 ++++ scripts/publish.sh | 1 + yazi-fm/src/signals.rs | 10 ++-------- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index 1c0b17e9a..19e0d6559 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -37,10 +37,14 @@ body: label: "`yazi --debug` output" description: Please do a `yazi --debug` and paste the output here. value: | +
+ ```sh ``` + +
validations: required: true - type: textarea diff --git a/scripts/publish.sh b/scripts/publish.sh index 8e8d4abe8..e35ba6d2d 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -1,5 +1,6 @@ cargo publish -p yazi-shared cargo publish -p yazi-config +cargo publish -p yazi-proxy cargo publish -p yazi-adaptor cargo publish -p yazi-boot cargo publish -p yazi-scheduler diff --git a/yazi-fm/src/signals.rs b/yazi-fm/src/signals.rs index 35933d638..8a1a8b2ba 100644 --- a/yazi-fm/src/signals.rs +++ b/yazi-fm/src/signals.rs @@ -55,17 +55,11 @@ impl Signals { let tx = self.tx.clone(); Ok(tokio::spawn(async move { while let Some(signal) = signals.next().await { - if HIDER.try_acquire().is_err() { - continue; - } - match signal { SIGHUP | SIGTERM | SIGQUIT | SIGINT => { - if tx.send(Event::Quit(Default::default())).is_err() { - break; - } + tx.send(Event::Quit(Default::default())).ok(); } - SIGCONT => AppProxy::resume(), + SIGCONT if HIDER.try_acquire().is_ok() => AppProxy::resume(), _ => {} } }