@@ -58,6 +58,7 @@ for (const spec of upstreamSpecs) {
58
58
const getShellSpecificGlobals : Map < TerminalShellType , ( options : ExecOptionsWithStringEncoding , existingCommands ?: Set < string > ) => Promise < ( string | ICompletionResource ) [ ] > > = new Map ( [
59
59
[ TerminalShellType . Bash , getBashGlobals ] ,
60
60
[ TerminalShellType . Zsh , getZshGlobals ] ,
61
+ [ TerminalShellType . GitBash , getBashGlobals ] , // Git Bash is a bash shell
61
62
// TODO: Ghost text in the command line prevents completions from working ATM for fish
62
63
[ TerminalShellType . Fish , getFishGlobals ] ,
63
64
[ TerminalShellType . PowerShell , getPwshGlobals ] ,
@@ -72,7 +73,11 @@ async function getShellGlobals(shellType: TerminalShellType, existingCommands?:
72
73
if ( ! shellType ) {
73
74
return ;
74
75
}
75
- const options : ExecOptionsWithStringEncoding = { encoding : 'utf-8' , shell : shellType } ;
76
+ let execShellType = shellType ;
77
+ if ( shellType === TerminalShellType . GitBash ) {
78
+ execShellType = TerminalShellType . Bash ; // Git Bash is a bash shell
79
+ }
80
+ const options : ExecOptionsWithStringEncoding = { encoding : 'utf-8' , shell : execShellType , windowsHide : true } ;
76
81
const mixedCommands : ( string | ICompletionResource ) [ ] | undefined = await getShellSpecificGlobals . get ( shellType ) ?.( options , existingCommands ) ;
77
82
const normalizedCommands = mixedCommands ?. map ( command => typeof command === 'string' ? ( { label : command } ) : command ) ;
78
83
cachedGlobals . set ( shellType , normalizedCommands ) ;
0 commit comments