fix(app): terminal clone needs remount
This commit is contained in:
@@ -150,13 +150,18 @@ function createTerminalSession(sdk: ReturnType<typeof useSDK>, dir: string, sess
|
|||||||
return undefined
|
return undefined
|
||||||
})
|
})
|
||||||
if (!clone?.data) return
|
if (!clone?.data) return
|
||||||
setStore("all", index, {
|
|
||||||
...pty,
|
const active = store.active === pty.id
|
||||||
...clone.data,
|
|
||||||
|
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) {
|
open(id: string) {
|
||||||
setStore("active", id)
|
setStore("active", id)
|
||||||
|
|||||||
@@ -2474,7 +2474,15 @@ export default function Page() {
|
|||||||
display: terminal.active() === pty.id ? "block" : "none",
|
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>
|
</div>
|
||||||
)}
|
)}
|
||||||
</For>
|
</For>
|
||||||
|
|||||||
Reference in New Issue
Block a user