diff options
| author | Rahul A Mistry <[email protected]> | 2026-01-21 00:33:01 +0530 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-01-20 13:03:01 -0600 |
| commit | 80481c2247e98f2c01f43faf814d4d3611526862 (patch) | |
| tree | 06609f1baea36fc9ec75bfa46ef3c8d7deb0c19e | |
| parent | 156ce54362f1ef18bd40c408e235f47193f92d1e (diff) | |
| download | opencode-80481c2247e98f2c01f43faf814d4d3611526862.tar.gz opencode-80481c2247e98f2c01f43faf814d4d3611526862.zip | |
fix(app): cleanup pty.exited event listener on unmount (#9671)
| -rw-r--r-- | packages/app/src/context/terminal.tsx | 3 |
1 files changed, 2 insertions, 1 deletions
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<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, |
