diff --git a/extensions/terminal-suggest/src/terminalSuggestMain.ts b/extensions/terminal-suggest/src/terminalSuggestMain.ts index 92543952287..8c26fc8cefd 100644 --- a/extensions/terminal-suggest/src/terminalSuggestMain.ts +++ b/extensions/terminal-suggest/src/terminalSuggestMain.ts @@ -128,6 +128,12 @@ async function fetchAndCacheShellGlobals( ): Promise { const cacheKey = getCacheKey(machineId ?? 'no-machine-id', remoteAuthority, shellType); + // Check if there's a cached entry + const cached = cachedGlobals.get(cacheKey); + if (cached) { + return cached.commands; + } + // Check if there's already an in-flight request for this cache key const existingRequest = inflightRequests.get(cacheKey); if (existingRequest) {