mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 00:02:31 +00:00
docs(terminal): record why the leaf walk counts an empty binding
The ownership walk refuses one; the two rules look like an oversight without the reason they differ.
This commit is contained in:
@@ -23,6 +23,8 @@ export function findTerminalTabIdBindingLeafId(
|
||||
let unboundCarrierTabId: string | null = null
|
||||
for (const [tabId, layout] of Object.entries(state.terminalLayoutsByTabId)) {
|
||||
const carriesLeaf = layout.root ? collectLeafIdsInOrder(layout.root).includes(leafId) : null
|
||||
// Why `!== undefined` and not truthiness, unlike the ownership walk: an empty binding still
|
||||
// proves this tab holds the leaf id, and holding it is what forbids re-minting it elsewhere.
|
||||
if (layout.ptyIdsByLeafId?.[leafId] !== undefined && carriesLeaf !== false) {
|
||||
return tabId
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user