From 80481c2247e98f2c01f43faf814d4d3611526862 Mon Sep 17 00:00:00 2001 From: Rahul A Mistry <149420892+ProdigyRahul@users.noreply.github.com> Date: Wed, 21 Jan 2026 00:33:01 +0530 Subject: [PATCH] fix(app): cleanup pty.exited event listener on unmount (#9671) --- packages/app/src/context/terminal.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/app/src/context/terminal.tsx b/packages/app/src/context/terminal.tsx index 6f92b4adf..5732114b4 100644 --- a/packages/app/src/context/terminal.tsx +++ b/packages/app/src/context/terminal.tsx @@ -38,7 +38,7 @@ function createTerminalSession(sdk: ReturnType, 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, dir: string, sess } }) }) + onCleanup(unsub) return { ready,