Skip to content

Commit 3b9aee0

Browse files
authored
Merge pull request microsoft#223745 from microsoft/tyriar/223658
Enable directory filtering/triggers when any completion is a dir
2 parents 4948419 + d0333d6 commit 3b9aee0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/vs/workbench/contrib/terminalContrib/suggest/browser/terminalSuggestAddon.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,12 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest
356356
this._cursorIndexDelta = 0;
357357

358358
let leadingLineContent = this._leadingLineContent + this._currentPromptInputState.value.substring(this._leadingLineContent.length, this._leadingLineContent.length + this._cursorIndexDelta);
359-
this._isFilteringDirectories = completions.some(e => e.completion.isDirectory) && completions.every(e => e.completion.isDirectory || e.completion.isFile);
359+
// If there is a single directory in the completions:
360+
// - `\` and `/` are normalized such that either can be used
361+
// - Using `\` or `/` will request new completions. It's important that this only occurs
362+
// when a directory is present, if not completions like git branches could be requested
363+
// which leads to flickering
364+
this._isFilteringDirectories = completions.some(e => e.completion.isDirectory);
360365
if (this._isFilteringDirectories) {
361366
const firstDir = completions.find(e => e.completion.isDirectory);
362367
this._pathSeparator = firstDir?.completion.label.match(/(?<sep>[\\\/])/)?.groups?.sep ?? sep;

0 commit comments

Comments
 (0)