fix(app): cleanup pty.exited event listener on unmount (#9671)

This commit is contained in:
Rahul A Mistry
2026-01-21 00:33:01 +05:30
committed by GitHub
parent 156ce54362
commit 80481c2247

View File

@@ -38,7 +38,7 @@ function createTerminalSession(sdk: ReturnType<typeof useSDK>, dir: string, sess
}), }),
) )
sdk.event.on("pty.exited", (event) => { const unsub = sdk.event.on("pty.exited", (event) => {
const id = event.properties.id const id = event.properties.id
if (!store.all.some((x) => x.id === id)) return if (!store.all.some((x) => x.id === id)) return
batch(() => { batch(() => {
@@ -52,6 +52,7 @@ function createTerminalSession(sdk: ReturnType<typeof useSDK>, dir: string, sess
} }
}) })
}) })
onCleanup(unsub)
return { return {
ready, ready,