mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 20:26:08 +00:00
improve pwsh logic
This commit is contained in:
@@ -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:
|
||||
[
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user