mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-13 04:27:47 -05:00
term: send SIGTERM/SIGKILL to the entire process group
This commit is contained in:
parent
98e8778e41
commit
f1d440e139
2 changed files with 10 additions and 8 deletions
|
|
@ -46,6 +46,8 @@
|
|||
terminating the client application) from 4 to 60 seconds.
|
||||
* When terminating the client application, foot now sends `SIGTERM` immediately
|
||||
after closing the PTY, instead of waiting 2 seconds.
|
||||
* Foot now sends `SIGTERM`/`SIGKILL` to the client application’s process group,
|
||||
instead of just to the client application’s process.
|
||||
|
||||
|
||||
### Deprecated
|
||||
|
|
|
|||
16
terminal.c
16
terminal.c
|
|
@ -1426,7 +1426,7 @@ fdm_terminate_timeout(struct fdm *fdm, int fd, int events, void *data)
|
|||
LOG_DBG("slave (PID=%u) has not terminated, sending SIGKILL (%d)",
|
||||
term->slave, SIGKILL);
|
||||
|
||||
kill(term->slave, SIGKILL);
|
||||
kill(-term->slave, SIGKILL);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1460,10 +1460,10 @@ term_shutdown(struct terminal *term)
|
|||
close(term->ptmx);
|
||||
|
||||
if (!term->shutdown.client_has_terminated) {
|
||||
LOG_DBG("initiating asynchronous terminate of slave (PID=%u)",
|
||||
term->slave);
|
||||
LOG_DBG("initiating asynchronous terminate of slave; "
|
||||
"sending SIGTERM to PID=%u", term->slave);
|
||||
|
||||
kill(term->slave, SIGTERM);
|
||||
kill(-term->slave, SIGTERM);
|
||||
|
||||
const struct itimerspec timeout = {.it_value = {.tv_sec = 60}};
|
||||
|
||||
|
|
@ -1642,10 +1642,10 @@ term_destroy(struct terminal *term)
|
|||
if (term->shutdown.client_has_terminated)
|
||||
exit_status = term->shutdown.exit_status;
|
||||
else {
|
||||
LOG_DBG("initiating blocking terminate of slave (PID=%u)",
|
||||
term->slave);
|
||||
LOG_DBG("initiating blocking terminate of slave; "
|
||||
"sending SIGTERM to PID=%u", term->slave);
|
||||
|
||||
kill(term->slave, SIGTERM);
|
||||
kill(-term->slave, SIGTERM);
|
||||
|
||||
/*
|
||||
* we’ve closed the ptxm, and sent SIGTERM to the client
|
||||
|
|
@ -1680,7 +1680,7 @@ term_destroy(struct terminal *term)
|
|||
"slave (PID=%u) has not terminate yet, "
|
||||
"sending: SIGKILL (%d)", term->slave, SIGKILL);
|
||||
|
||||
kill(term->slave, SIGKILL);
|
||||
kill(-term->slave, SIGKILL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue