Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!lxss || !lxss.DefaultDistribution || !isWindowsBuild(WIN_BUILD_WSL_EXE_DISTRO_FLAG)) {
if (await fs.exists(bashPath)) {
return [{
id: 'wsl',
name: 'WSL / Bash on Windows',
command: bashPath,
env: {
TERM: 'xterm-color',
COLORTERM: 'truecolor',
}
}]
} else {
return []
}
}
for (const child of wnr.listRegistrySubkeys(wnr.HK.CU, lxssPath)) {
const childKey = wnr.getRegistryKey(wnr.HK.CU, lxssPath + '\\' + child)
if (!childKey.DistributionName) {
continue
}
const name = childKey.DistributionName.value
shells.push({
id: `wsl-${slug(name)}`,
name: `WSL / ${name}`,
command: wslPath,
args: ['-d', name],
fsBase: childKey.BasePath.value + '\\rootfs',
env: {
TERM: 'xterm-color',
COLORTERM: 'truecolor',
}
})