Repository navigation
Conversation
A close whose terminal.kill core does not confirm now logs the terminal at warn and posts a notice naming it, instead of leaving it running with no word. A restart keeps only the programs of panes the session saves, so a popup's program ends with the server. A pane moved to another workspace relabels its terminal's herdr.pane_id with its new id; a restore attaches a terminal still labelled for a former id of the pane (moved before this, or before the relabel landed) and relabels it, where it used to start the pane fresh and leave the old program running. A live handoff now carries the panes' former ids, as a session save does. refs https://gitea.cat-bluegill.ts.net/AC-forks/herdr-max/issues/347 Work-Ref: WORK-05
pane.orphan.list names this session's live core terminals that no pane shows (the startup check's orphans); pane.orphan.adopt attaches a new pane to one, in a new workspace or a new tab of a given one, starting nothing; pane.orphan.end ends one with core's kill. Both act only on a terminal that is still an orphan of this Mac's core. The CLI is herdr pane orphans, herdr pane adopt and herdr pane end-orphan, and the startup and close notices name it. refs https://gitea.cat-bluegill.ts.net/AC-forks/herdr-max/issues/347 Work-Ref: WORK-05
…he pane Workspace, tab and pane closes end their terminals; a close core does not confirm names the program; a move keeps the program and relabels it; a restart keeps only saved panes' programs; a terminal labelled for a pane's former id attaches on restore; an orphan at startup is listed, not killed, and can be adopted or ended. The fake core learns terminal.label. The CLI inventory pins the new commands. refs https://gitea.cat-bluegill.ts.net/AC-forks/herdr-max/issues/347 Work-Ref: WORK-05
…ys so A respawn replaces the pane's program; when core did not confirm the old one ended, it may run on with no pane, so the same notice names it. refs https://gitea.cat-bluegill.ts.net/AC-forks/herdr-max/issues/347 Work-Ref: WORK-05
…a failed relabel never strands it The adoption saves the orphan's herdr.pane_id as a former public id of the pane that adopted it, as a move's is. A relabel that fails, or a restart before it lands, leaves the terminal labelled for the old id; the next restore finds it by that id instead of starting the pane fresh. refs https://gitea.cat-bluegill.ts.net/AC-forks/herdr-max/issues/347 Work-Ref: WORK-05
…retry A pane that waited because core did not answer at restore kept only its current id; once core answered, a terminal still labelled for the id the pane had before a move failed the ownership check on every retry. The retry now tries the pane's former ids, as the first restore does, and labels the terminal for the pane's id now. refs https://gitea.cat-bluegill.ts.net/AC-forks/herdr-max/issues/347 Work-Ref: WORK-05
…rred or not pane.orphan.list, adopt and end reused the startup scanner, which answers none when this server neither prefers core nor shows a core pane. After a switch to runtime = "pty" and the close of the last core panes with kills core did not confirm, the commands the close's notice names found nothing. They now scan every known core session that answers; the startup check keeps its guard. refs https://gitea.cat-bluegill.ts.net/AC-forks/herdr-max/issues/347 Work-Ref: WORK-05
…close does pane.orphan.end called only terminal.kill, so a detached job of the orphaned shell (nohup sleep 300 &) could outlive it, and with the terminal finished no listing showed the job. The end now shares the close's kill-and-sweep: it lists the program's session before the kill, skips the sweep when that session is core's own, and signals the rest. The startup test's ended orphan now runs a program of the test's own, since the end sweeps its pid's session. refs https://gitea.cat-bluegill.ts.net/AC-forks/herdr-max/issues/347 Work-Ref: WORK-05
…ver loop pane.orphan.list, adopt and end scanned every known core session on the server loop: up to two lists per session with 5 s timeouts each, so a slow core froze input and requests for seconds. As worktree reads do, the server hands them to a worker thread with the loop's claims. A list or an end answers from the worker; an adopt's worker reads the orphan's record and hands it back to the loop (AppEvent::CoreOrphanFound), which checks the workspace and the claims again and adds the pane. refs https://gitea.cat-bluegill.ts.net/AC-forks/herdr-max/issues/347 Work-Ref: WORK-05
…ore, and end detached jobs refs https://gitea.cat-bluegill.ts.net/AC-forks/herdr-max/issues/347 Work-Ref: WORK-05
colangelo
force-pushed
the
issue/347-orphan-terminal
branch
from
November 29, 2026 13:57
11f8ff5 to
83c7f99
Compare
Owner
Author
|
Landed on master after all-green CI and a passing just check. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
herdrdev#347 https://gitea.cat-bluegill.ts.net/AC-forks/herdr-max/issues/347: a herdr-core program never outlives its pane unseen. On m4m, core terminal t2v (an idle zsh, labelled for gone pane w1H:p2) was found running with no pane after the 0.14.1 handoff.
Likely cause: a pane moved to another workspace gets a new id, but its core terminal kept the old
herdr.pane_idlabel. On the next restore or handoff the attach was refused, the search by the new id found nothing, a fresh shell started, and the old terminal ran on unseen.Evidence
closing_a_workspace_ends_its_core_terminalsclosing_a_pane_or_a_tab_ends_its_core_terminal,a_close_core_does_not_confirm_names_the_program_left_runninga_pane_moved_to_another_workspace_keeps_its_program_and_takes_its_new_ida_restart_keeps_only_the_programs_of_saved_panesa_terminal_labelled_for_a_former_id_attaches_and_takes_the_new_onean_orphan_at_startup_is_listed_not_killed_and_can_be_adopted_or_endedan_adopted_orphan_whose_relabel_failed_attaches_again_after_a_restart,a_pane_waiting_for_core_attaches_by_its_former_id_when_core_answers,a_slow_core_never_holds_the_server_loop_for_an_orphan_request,ending_an_orphan_sweeps_its_session_and_its_detached_jobs,the_orphan_commands_see_core_programs_after_a_switch_to_ptyjust checkpasses on the PR head (m4m).Merge Danger
Door: two-way
There are new API methods (advertised, fork-only) and no frozen-fixture change.
Blast Radius: medium
It affects restore, handoff, restart and close for core-backed panes. A pane found by a former id now attaches instead of starting fresh.
herdr server restartno longer keeps popup runtimes.