improve pwsh logic

This commit is contained in:
meganrogge
2021-03-17 13:50:50 -07:00
parent e01b60782a
commit b0bbf9c19e
2 changed files with 6 additions and 7 deletions

View File

@@ -102,7 +102,7 @@ export const terminalConfiguration: IConfigurationNode = {
],
args: []
},
'Windows Powershell': {
'Windows PowerShell': {
comment: 'note that this will not be included in the quickSelect drop down if another version of powershell is installed',
path:
[

View File

@@ -82,12 +82,6 @@ async function detectAvailableWindowsProfiles(quickLaunchOnly: boolean, logServi
if (!quickLaunchOnly) {
return detectedProfiles;
}
// only show the windows powershell profile if no other powershell profile exists
if (detectedProfiles.find(p => p.profileName === 'PowerShell')) {
detectedProfiles = detectedProfiles.filter(p => p.profileName !== 'Windows PowerShell');
}
let validProfiles: ITerminalProfile[] = [];
if (detectedProfiles && configProfiles) {
@@ -151,6 +145,11 @@ async function detectAvailableWindowsProfiles(quickLaunchOnly: boolean, logServi
} else {
logService?.trace(`No detected profiles ${JSON.stringify(detectedProfiles)} or ${JSON.stringify(configProfiles)}`);
}
// only show the windows powershell profile if no other powershell profile exists
if (validProfiles.find(p => p.path.endsWith('pwsh.exe'))) {
validProfiles = validProfiles.filter(p => p.profileName !== 'Windows PowerShell');
}
return validProfiles;
}