diff options
| author | adamelmore <[email protected]> | 2026-01-24 16:38:52 -0600 |
|---|---|---|
| committer | adamelmore <[email protected]> | 2026-01-24 16:58:43 -0600 |
| commit | 3fdd6ec120c0a48b19e48a134f9afc50f8febc72 (patch) | |
| tree | d550d9b45dc061791ba6e3f7ec7134439ef34c81 | |
| parent | 2f1be914cdd396ff777eeae920b45c9c820ab840 (diff) | |
| download | opencode-3fdd6ec120c0a48b19e48a134f9afc50f8febc72.tar.gz opencode-3fdd6ec120c0a48b19e48a134f9afc50f8febc72.zip | |
fix(app): terminal clone needs remount
| -rw-r--r-- | packages/app/src/context/terminal.tsx | 17 | ||||
| -rw-r--r-- | packages/app/src/pages/session.tsx | 10 |
2 files changed, 20 insertions, 7 deletions
diff --git a/packages/app/src/context/terminal.tsx b/packages/app/src/context/terminal.tsx index 72f93edc2..439b196c6 100644 --- a/packages/app/src/context/terminal.tsx +++ b/packages/app/src/context/terminal.tsx @@ -150,13 +150,18 @@ function createTerminalSession(sdk: ReturnType<typeof useSDK>, dir: string, sess return undefined }) if (!clone?.data) return - setStore("all", index, { - ...pty, - ...clone.data, + + const active = store.active === pty.id + + batch(() => { + setStore("all", index, { + ...pty, + ...clone.data, + }) + if (active) { + setStore("active", clone.data.id) + } }) - if (store.active === pty.id) { - setStore("active", clone.data.id) - } }, open(id: string) { setStore("active", id) diff --git a/packages/app/src/pages/session.tsx b/packages/app/src/pages/session.tsx index 01368896e..ada1b4ffc 100644 --- a/packages/app/src/pages/session.tsx +++ b/packages/app/src/pages/session.tsx @@ -2474,7 +2474,15 @@ export default function Page() { display: terminal.active() === pty.id ? "block" : "none", }} > - <Terminal pty={pty} onCleanup={terminal.update} onConnectError={() => terminal.clone(pty.id)} /> + <Show when={pty.id} keyed> + {() => ( + <Terminal + pty={pty} + onCleanup={terminal.update} + onConnectError={() => terminal.clone(pty.id)} + /> + )} + </Show> </div> )} </For> |
