Skip to content

Commit 8b0f80c

Browse files
authored
Merge pull request microsoft#242117 from microsoft/tyriar/241702_2
Remove cwd fallback, ensuring we don't suggest non-existent folders
2 parents 1ea4463 + c25c5e8 commit 8b0f80c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

extensions/terminal-suggest/src/terminalSuggestMain.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export async function resolveCwdFromPrefix(prefix: string, currentCwd?: vscode.U
170170
}
171171

172172
// If the prefix is not a folder, return the current cwd
173-
return currentCwd;
173+
return undefined;
174174
}
175175

176176
function getPrefix(commandLine: string, cursorPosition: number): string {
@@ -277,7 +277,7 @@ export async function getCompletionItemsFromSpecs(
277277

278278
let cwd: vscode.Uri | undefined;
279279
if (shellIntegrationCwd && (filesRequested || foldersRequested)) {
280-
cwd = await resolveCwdFromPrefix(prefix, shellIntegrationCwd) ?? shellIntegrationCwd;
280+
cwd = await resolveCwdFromPrefix(prefix, shellIntegrationCwd);
281281
}
282282

283283
return { items, filesRequested, foldersRequested, fileExtensions, cwd };

0 commit comments

Comments
 (0)