Skip to content

Commit c25c5e8

Browse files
committed
Remove cwd fallback, ensuring we don't suggest non-existent folders
Fixes microsoft#241702
1 parent c75ab9d commit c25c5e8

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)