Guard delayed terminal exit callback

- Skip `onSessionExited` if exit handling was reset before timeout runs
- Prevent stale async exit callbacks from firing in terminal drawer
This commit is contained in:
Julius Marminge committed 2026-02-27 18:02:09 -08:00
1 parent dd5b985d26
commit e6fd90df22
1 file changed
+3
@@ -349,6 +349,9 @@ function TerminalViewport({
}
hasHandledExitRef.current = true;
window.setTimeout(() => {
if (!hasHandledExitRef.current) {
return;
}
onSessionExitedRef.current();
}, 0);
}