feat(maestro): close a tab when its last session dies
ci / web (push) Successful in 34s
ci / rust (push) Successful in 3m36s
ci / flake (push) Successful in 6m41s

Killing the only session in a tab left an empty tab behind for the operator to close by hand. The pane's tab now goes with it, unless it is the last tab (which stays, emptied).
This commit is contained in:
Miguel Palhas
2026-08-31 09:16:15 +01:00
parent 8110512d5b
commit d101574842
2 changed files with 100 additions and 1 deletions
+4
View File
@@ -553,6 +553,10 @@ export function createMultiView(opts: MultiViewOptions): MultiView {
if (loc.tab.focusedLeafId === loc.leaf.id) {
loc.tab.focusedLeafId = leaves(loc.tab.root)[0]?.id ?? null;
}
// A tab that held nothing but the dead session goes with it (#137): a killed
// session should not leave an empty tab behind for the operator to close by
// hand. `closeTab` keeps the last tab (emptied) so there is always one.
if (!loc.tab.root) closeTab(layout, loc.tab.id);
render();
}