feat(maestro): close a tab when its last session dies
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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user