Skip to content

Commit 43a4acc

Browse files
committed
Apply path separator normalization to git branches
Fixes #255864
1 parent 92b442b commit 43a4acc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,16 @@ export class TerminalCompletionItem extends SimpleCompletionItem {
122122
this.labelLowExcludeFileExt = this.labelLow;
123123
this.labelLowNormalizedPath = this.labelLow;
124124

125-
if (isFile(completion)) {
125+
// HACK: Treat branch as a path separator, otherwise they get filtered out. Hard code the
126+
// documentation for now, but this would be better to come in through a `kind`
127+
// See https://github.com/microsoft/vscode/issues/255864
128+
if (isFile(completion) || completion.documentation === 'Branch') {
126129
if (isWindows) {
127130
this.labelLow = this.labelLow.replaceAll('/', '\\');
128131
}
132+
}
133+
134+
if (isFile(completion)) {
129135
// Don't include dotfiles as extensions when sorting
130136
const extIndex = this.labelLow.lastIndexOf('.');
131137
if (extIndex > 0) {

0 commit comments

Comments
 (0)