當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript processes.getWindowsShell函數代碼示例

本文整理匯總了TypeScript中vs/base/node/processes.getWindowsShell函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript getWindowsShell函數的具體用法?TypeScript getWindowsShell怎麽用?TypeScript getWindowsShell使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了getWindowsShell函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: getTerminalDefaultShellWindows

export function getTerminalDefaultShellWindows(): string {
	if (!_TERMINAL_DEFAULT_SHELL_WINDOWS) {
		const isAtLeastWindows10 = platform.isWindows && parseFloat(os.release()) >= 10;
		const is32ProcessOn64Windows = process.env.hasOwnProperty('PROCESSOR_ARCHITEW6432');
		const powerShellPath = `${process.env.windir}\\${is32ProcessOn64Windows ? 'Sysnative' : 'System32'}\\WindowsPowerShell\\v1.0\\powershell.exe`;
		_TERMINAL_DEFAULT_SHELL_WINDOWS = isAtLeastWindows10 ? powerShellPath : processes.getWindowsShell();
	}
	return _TERMINAL_DEFAULT_SHELL_WINDOWS;
}
開發者ID:burhandodhy,項目名稱:azuredatastudio,代碼行數:9,代碼來源:terminal.ts

示例2: getDefaultShell

export function getDefaultShell(p: platform.Platform): string {
	if (p === platform.Platform.Windows) {
		if (platform.isWindows) {
			return getTerminalDefaultShellWindows();
		}
		// Don't detect Windows shell when not on Windows
		return processes.getWindowsShell();
	}
	// Only use $SHELL for the current OS
	if (platform.isLinux && p === platform.Platform.Mac || platform.isMacintosh && p === platform.Platform.Linux) {
		return '/bin/bash';
	}
	return getTerminalDefaultShellUnixLike();
}
開發者ID:DonJayamanne,項目名稱:vscode,代碼行數:14,代碼來源:terminal.ts

示例3: parseFloat

/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
'use strict';

import * as cp from 'child_process';
import * as os from 'os';
import * as platform from 'vs/base/common/platform';
import * as processes from 'vs/base/node/processes';

export const TERMINAL_DEFAULT_SHELL_LINUX = !platform.isWindows ? (process.env.SHELL || 'sh') : 'sh';
export const TERMINAL_DEFAULT_SHELL_OSX = !platform.isWindows ? (process.env.SHELL || 'sh') : 'sh';

const isAtLeastWindows10 = platform.isWindows && parseFloat(os.release()) >= 10;
const is64BitWindows = process.env.hasOwnProperty('PROCESSOR_ARCHITEW6432');
const powerShellPath = `${process.env.windir}\\${is64BitWindows ? 'Sysnative' : 'System32'}\\WindowsPowerShell\\v1.0\\powershell.exe`;

export const TERMINAL_DEFAULT_SHELL_WINDOWS = isAtLeastWindows10 ? powerShellPath : processes.getWindowsShell();

export interface ITerminalProcessFactory {
	create(env: { [key: string]: string }): cp.ChildProcess;
}
開發者ID:FabianLauer,項目名稱:vscode,代碼行數:23,代碼來源:terminal.ts


注:本文中的vs/base/node/processes.getWindowsShell函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。