don't offer separate wsl distros until Win 10 17763 (fixes #642)

This commit is contained in:
Eugene Pankov 2019-02-20 00:04:06 +01:00
parent 478d715d10
commit 77c253594f
2 changed files with 3 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import { Injectable } from '@angular/core'
import { HostAppService, Platform } from 'terminus-core'
import { ShellProvider, IShell } from '../api'
import { isWindowsBuild, WIN_BUILD_WSL_EXE_DISTRO_FLAG } from '../utils'
@Injectable()
export class WSLShellProvider extends ShellProvider {
@ -34,7 +35,7 @@ export class WSLShellProvider extends ShellProvider {
}]
let lxss = await Registry.get('HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Lxss', true)
if (!lxss || !lxss.$values.defaultdistribution) {
if (!lxss || !lxss.$values.defaultdistribution || !isWindowsBuild(WIN_BUILD_WSL_EXE_DISTRO_FLAG)) {
if (await fs.exists(bashPath)) {
return [{
id: 'wsl',

View File

@ -2,6 +2,7 @@ import * as os from 'os'
export const WIN_BUILD_CONPTY_SUPPORTED = 17692
export const WIN_BUILD_CONPTY_STABLE = 18309
export const WIN_BUILD_WSL_EXE_DISTRO_FLAG = 17763
export function isWindowsBuild (build: number): boolean {
return process.platform === 'win32' && parseFloat(os.release()) >= 10 && parseInt(os.release().split('.')[2]) >= build