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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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
if (!store.all.some((x) => x.id === id)) return
batch(() => {
@ -52,6 +52,7 @@ function createTerminalSession(sdk: ReturnType<typeof useSDK>, dir: string, sess
}
})
})
onCleanup(unsub)
return {
ready,