From 5ee1e87a917bdca38351feeca88999cd67440994 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 28 Sep 2026 22:01:41 -0300 Subject: A command pane's background job outlives its command A dogfood agent's background jobs died when the command that started them finished, even under nohup. The command's shell leads its terminal's session, and on its exit the kernel hangs up the terminal's foreground group, which with job control off is the shell's and every job's. The line now runs with job control on (bash, sh, dash, zsh, ksh -m; fish status job-control full), so a job has a group of its own and lives on, printing below exit N, and survives the pane closing. While a job holds the pty the pane is not reused, so the directory's next command gets a second pane (cmdexit's golden, re-recorded by name). Co-Authored-By: Claude Opus 5.5 --- test/snapshots/cmdexit.golden | 6 +++--- test/snapshots/cmdexit.snap | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/snapshots/cmdexit.golden b/test/snapshots/cmdexit.golden index de95c383..4e9dc5fc 100644 --- a/test/snapshots/cmdexit.golden +++ b/test/snapshots/cmdexit.golden @@ -10,6 +10,6 @@ |19: BGSTARTED |20: exit 0 == snap letgo grid=120x31 cursor=7,3 -|17: /tmp/pardes-snap/cmdexit/cwd (exec /dev/null 2>&1; sleep 1; false) exit 1 Kill Save Collapse Del -|21: % exec /dev/null 2>&1; sleep 1; false -|22: exit 1 +|22: /tmp/pardes-snap/cmdexit/cwd (exec /dev/null 2>&1; sleep 1; false) exit 1 Kill Save Collapse Del +|23: % exec /dev/null 2>&1; sleep 1; false +|24: exit 1 diff --git a/test/snapshots/cmdexit.snap b/test/snapshots/cmdexit.snap index ff60a881..e9f39bfd 100644 --- a/test/snapshots/cmdexit.snap +++ b/test/snapshots/cmdexit.snap @@ -16,8 +16,10 @@ release middle 34 4 wait 10000 exit 0 stable 700 15000 snap background -# line 2, in the same pane now its command is done: its end of file comes at -# once, and its exit a second later, from `false` +# line 2, in a second pane: the first's command is done but its background +# `sleep 30` lives on (job control gives it its own group) and still holds +# that pane's pty; here the end of file comes at once, and the exit a second +# later, from `false` press middle 7 5 drag middle 54 5 release middle 54 5 -- cgit v1.3