(dir: string, legacySessionID: string | undefined, serverScope: ServerScopeValue)
| 404 | } |
| 405 | |
| 406 | const loadWorkspace = (dir: string, legacySessionID: string | undefined, serverScope: ServerScopeValue) => { |
| 407 | // Terminals are workspace-scoped so tabs persist while switching sessions in the same directory. |
| 408 | const key = getWorkspaceTerminalCacheKey(dir, serverScope) |
| 409 | const existing = cache.get(key) |
| 410 | if (existing) { |
| 411 | cache.delete(key) |
| 412 | cache.set(key, existing) |
| 413 | return existing.value |
| 414 | } |
| 415 | |
| 416 | const entry = createRoot((dispose) => ({ |
| 417 | value: createWorkspaceTerminalSession(sdk(), dir, serverScope, legacySessionID), |
| 418 | dispose, |
| 419 | })) |
| 420 | |
| 421 | cache.set(key, entry) |
| 422 | prune() |
| 423 | return entry.value |
| 424 | } |
| 425 | |
| 426 | const workspace = createMemo(() => loadWorkspace(directory(), params.id, scope())) |
| 427 |
no test coverage detected