Skip to content

Commit

Permalink
fix: respond to the SIGTERM signal even when Yazi is in the backgro…
Browse files Browse the repository at this point in the history
…und and has passed control of the terminal to the spawned process
  • Loading branch information
sxyazi committed Mar 10, 2024
1 parent b10f2de commit cf666fd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,14 @@ body:
label: "`yazi --debug` output"
description: Please do a `yazi --debug` and paste the output here.
value: |
<details>
<!-- Paste the output between the backticks below: -->
```sh
```
</details>
validations:
required: true
- type: textarea
Expand Down
1 change: 1 addition & 0 deletions scripts/publish.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 2 additions & 8 deletions yazi-fm/src/signals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
_ => {}
}
}
Expand Down

0 comments on commit cf666fd

Please sign in to comment.