( dir: string, sessionIDs?: string[], platform?: Platform, scope: ServerScopeValue = ServerScope.local, )
| 118 | } |
| 119 | |
| 120 | export function clearWorkspaceTerminals( |
| 121 | dir: string, |
| 122 | sessionIDs?: string[], |
| 123 | platform?: Platform, |
| 124 | scope: ServerScopeValue = ServerScope.local, |
| 125 | ) { |
| 126 | const key = getWorkspaceTerminalCacheKey(dir, scope) |
| 127 | for (const cache of caches) { |
| 128 | const entry = cache.get(key) |
| 129 | entry?.value.clear() |
| 130 | } |
| 131 | |
| 132 | void removePersisted(terminalPersistTarget(scope, dir), platform) |
| 133 | |
| 134 | if (scope !== ServerScope.local) return |
| 135 | const legacy = new Set(getLegacyTerminalStorageKeys(dir)) |
| 136 | for (const id of sessionIDs ?? []) { |
| 137 | for (const key of getLegacyTerminalStorageKeys(dir, id)) { |
| 138 | legacy.add(key) |
| 139 | } |
| 140 | } |
| 141 | for (const key of legacy) { |
| 142 | void removePersisted({ key }, platform) |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | function createWorkspaceTerminalSession( |
| 147 | sdk: DirectorySDK, |
no test coverage detected