aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-03-13 20:36:30 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-03-13 20:36:30 +0000
commit4fca142f710c6a24698798a6b8702f6d875eadaa (patch)
treed3901977fc78bd84f3b58c5afe17a08b52102c4a
parentclient: repair usage output (diff)
parentterm: don’t close PTY when client application dies (diff)
Merge branch 'drain-pty-when-client-terminates'
-rw-r--r--CHANGELOG.md1
-rw-r--r--terminal.c12
2 files changed, 3 insertions, 10 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a6c03b88..8cf22411 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -108,6 +108,7 @@
exiting shell (https://codeberg.org/dnkl/foot/issues/366).
* Default value of `-t,--term` in `--help` output when foot was built
without terminfo support.
+* Drain PTY when the client application terminates.
### Security
diff --git a/terminal.c b/terminal.c
index 5cbb7fcf..88599094 100644
--- a/terminal.c
+++ b/terminal.c
@@ -991,16 +991,8 @@ slave_died(struct reaper *reaper, pid_t pid, int status, void *data)
term->slave_has_been_reaped = true;
term->exit_status = status;
- if (term->conf->hold_at_exit) {
- /* The PTMX FDM handler may already have closed our end */
- if (term->ptmx >= 0) {
- fdm_del(term->fdm, term->ptmx);
- term->ptmx = -1;
- }
- return;
- }
-
- term_shutdown(term);
+ if (!term->conf->hold_at_exit)
+ term_shutdown(term);
}
struct terminal *