Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix powershell profile source #120138

Merged
merged 2 commits into from Mar 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 9 additions & 7 deletions src/vs/workbench/contrib/terminal/node/terminalProfiles.ts
Expand Up @@ -140,18 +140,20 @@ async function initializeWindowsProfiles(): Promise<void> {
],
args: ['--login']
});
for (const profile of await getPowershellProfiles()) {
profileSources.set(profile.profileName, { profileName: profile.profileName, paths: profile.paths, args: profile.args });
}

profileSources.set('PowerShell', {
profileName: 'PowerShell',
paths: await getPowershellPaths()
});
}

async function getPowershellProfiles(): Promise<IPotentialTerminalProfile[]> {
const profiles: IPotentialTerminalProfile[] = [];
async function getPowershellPaths(): Promise<string[]> {
const paths: string[] = [];
// Add all of the different kinds of PowerShells
for await (const pwshExe of enumeratePowerShellInstallations()) {
profiles.push({ profileName: pwshExe.displayName, paths: [pwshExe.exePath] });
paths.push(pwshExe.exePath);
}
return profiles;
return paths;
}

async function getWslProfiles(wslPath: string, useWslProfiles?: boolean): Promise<ITerminalProfile[]> {
Expand Down