MCPcopy Create free account
hub / github.com/anomalyco/opencode / prune

Function prune

packages/app/src/context/terminal.tsx:396–404  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

394 onCleanup(disposeAll)
395
396 const prune = () => {
397 while (cache.size > MAX_TERMINAL_SESSIONS) {
398 const first = cache.keys().next().value
399 if (!first) return
400 const entry = cache.get(first)
401 entry?.dispose()
402 cache.delete(first)
403 }
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.

Callers 1

loadWorkspaceFunction · 0.70

Calls 4

getMethod · 0.65
nextMethod · 0.45
disposeMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected