未验证 提交 a1e2be77 编写于 作者: S SteVen Batten 提交者: GitHub

use wsl.exe on builds as of 16299 (#51182)

上级 d239ba1b
......@@ -6,6 +6,7 @@
import * as nls from 'vs/nls';
import * as pfs from 'vs/base/node/pfs';
import * as platform from 'vs/base/common/platform';
import * as os from 'os';
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle';
......@@ -213,10 +214,21 @@ export class TerminalService extends AbstractTerminalService implements ITermina
// module doesn't work if this is not the case. See #27915.
const is32ProcessOn64Windows = process.env.hasOwnProperty('PROCESSOR_ARCHITEW6432');
const system32Path = `${process.env['windir']}\\${is32ProcessOn64Windows ? 'Sysnative' : 'System32'}`;
const osVersion = (/(\d+)\.(\d+)\.(\d+)/g).exec(os.release());
let useWSLexe = false;
if (osVersion.length === 4) {
const buildNumber = parseInt(osVersion[3]);
if (buildNumber >= 16299) {
useWSLexe = true;
}
}
const expectedLocations = {
'Command Prompt': [`${system32Path}\\cmd.exe`],
PowerShell: [`${system32Path}\\WindowsPowerShell\\v1.0\\powershell.exe`],
'WSL Bash': [`${system32Path}\\bash.exe`],
'WSL Bash': [`${system32Path}\\${useWSLexe ? 'wsl.exe' : 'bash.exe'}`],
'Git Bash': [
`${process.env['ProgramW6432']}\\Git\\bin\\bash.exe`,
`${process.env['ProgramW6432']}\\Git\\usr\\bin\\bash.exe`,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册