pub(super) fn extras_to_close(
batch: &[(String, String)],
all: &[(String, String)],
runs: &dyn Fn(&str) -> bool,
) -> HashSet<String>Expand description
Of the blocks being closed, the ones that are extra blocks of their agent and so are closed, not
parked. batch is each closing parkable block with its agent; all every agent block in a tab or
parked with its agent; runs says whether a block has the agent’s live process.
Layouts from before one block per agent can hold two blocks for an agent, and parking both would leave it two parked blocks. One block per agent survives the close: the one that runs the agent’s process, else the first of them. A block of the agent outside this close stays, so when one runs it is the survivor and every closing block of that agent is extra, and when none runs the closing block that runs is parked beside it. Decided once for the whole close, so a tab or workspace close that covers both blocks keeps one of them.