Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

fix(terminal): the visibility observer never fires into a disposed effect

enesa579b026d40e
diff --git a/src/renderer/nodes/TerminalNode.tsx b/src/renderer/nodes/TerminalNode.tsx
index 8f157c89b..c7a05212e 100644
--- a/src/renderer/nodes/TerminalNode.tsx
+++ b/src/renderer/nodes/TerminalNode.tsx
@@ -1088,6 +1088,10 @@ export function TerminalNode({ id, data, selected, parentId }: NodeProps<CanvasN
}
const visibilityObserver = new IntersectionObserver(
(entries) => {
+ // disconnect() does not flush already-QUEUED notifications (Blink delivers them after),
+ // so a mount that unmounts within the initial-delivery window could otherwise acquire a
+ // context onto a parked/disposed terminal — the very leak this feature exists to prevent.
+ if (disposed) return
const visible = entries[entries.length - 1]?.isIntersecting ?? false
switch (webglVisibilityAction(visible, webgl !== null)) {
case 'acquire':