summaryrefslogtreecommitdiffhomepage
path: root/packages/app/src/context
diff options
context:
space:
mode:
authorRahul A Mistry <[email protected]>2026-01-20 21:12:20 +0530
committerGitHub <[email protected]>2026-01-20 09:42:20 -0600
commit01b12949e3a853dacbb75104461654fc95cee0a2 (patch)
tree9f97f52614c24e0434c0db1608584063742a3513 /packages/app/src/context
parentac7e674a87ec7efcbf504bd9277164bf8d383e66 (diff)
downloadopencode-01b12949e3a853dacbb75104461654fc95cee0a2.tar.gz
opencode-01b12949e3a853dacbb75104461654fc95cee0a2.zip
fix(app): terminal no longer hangs on exit or ctrl + D and closes the pane (#9506)
Diffstat (limited to 'packages/app/src/context')
-rw-r--r--packages/app/src/context/terminal.tsx15
1 files changed, 15 insertions, 0 deletions
diff --git a/packages/app/src/context/terminal.tsx b/packages/app/src/context/terminal.tsx
index 709d7b899..6f92b4adf 100644
--- a/packages/app/src/context/terminal.tsx
+++ b/packages/app/src/context/terminal.tsx
@@ -38,6 +38,21 @@ function createTerminalSession(sdk: ReturnType<typeof useSDK>, dir: string, sess
}),
)
+ sdk.event.on("pty.exited", (event) => {
+ const id = event.properties.id
+ if (!store.all.some((x) => x.id === id)) return
+ batch(() => {
+ setStore(
+ "all",
+ store.all.filter((x) => x.id !== id),
+ )
+ if (store.active === id) {
+ const remaining = store.all.filter((x) => x.id !== id)
+ setStore("active", remaining[0]?.id)
+ }
+ })
+ })
+
return {
ready,
all: createMemo(() => Object.values(store.all)),