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

pull/8940/head
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
1 changed files with 2 additions and 1 deletions

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,