Merge pull request #286524 from microsoft/tyriar/286138

Simplify wsl profile detection regex
This commit is contained in:
Daniel Imms
2026-01-08 05:28:39 -08:00
committed by GitHub

View File

@@ -359,8 +359,7 @@ async function getWslProfiles(wslPath: string, defaultProfileName: string | unde
if (!distroOutput) {
return [];
}
const regex = new RegExp(/[\r?\n]/);
const distroNames = distroOutput.split(regex).filter(t => t.trim().length > 0 && t !== '');
const distroNames = distroOutput.split(/\r?\n/).filter(t => t.trim().length > 0);
for (const distroName of distroNames) {
// Skip empty lines
if (distroName === '') {