mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-04-01 01:20:31 -04:00
Merge from vscode 2cfc8172e533e50c90e6a3152f6bfb1f82f963f3 (#6516)
* Merge from vscode 2cfc8172e533e50c90e6a3152f6bfb1f82f963f3 * fix tests
This commit is contained in:
@@ -8,7 +8,7 @@ import { AppInsightsAppender } from 'vs/platform/telemetry/node/appInsightsAppen
|
||||
import { TelemetryAppenderChannel } from 'vs/platform/telemetry/node/telemetryIpc';
|
||||
|
||||
const appender = new AppInsightsAppender(process.argv[2], JSON.parse(process.argv[3]), process.argv[4]);
|
||||
process.once('exit', () => appender.dispose());
|
||||
process.once('exit', () => appender.flush());
|
||||
|
||||
const channel = new TelemetryAppenderChannel(appender);
|
||||
const server = new Server('telemetry');
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
|
||||
import * as cp from 'child_process';
|
||||
import * as env from 'vs/base/common/platform';
|
||||
import { ITerminalSettings } from 'vs/workbench/contrib/debug/common/debug';
|
||||
import { getSystemShell } from 'vs/workbench/contrib/terminal/node/terminal';
|
||||
import { WindowsExternalTerminalService, MacExternalTerminalService, LinuxExternalTerminalService } from 'vs/workbench/contrib/externalTerminal/node/externalTerminalService';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IExternalTerminalService } from 'vs/workbench/contrib/externalTerminal/common/externalTerminal';
|
||||
import { ExtHostConfigProvider } from 'vs/workbench/api/common/extHostConfiguration';
|
||||
|
||||
let externalTerminalService: IExternalTerminalService | undefined = undefined;
|
||||
|
||||
export function runInExternalTerminal(args: DebugProtocol.RunInTerminalRequestArguments, config: ITerminalSettings): void {
|
||||
export function runInExternalTerminal(args: DebugProtocol.RunInTerminalRequestArguments, configProvider: ExtHostConfigProvider): void {
|
||||
if (!externalTerminalService) {
|
||||
if (env.isWindows) {
|
||||
externalTerminalService = new WindowsExternalTerminalService(<IConfigurationService><unknown>undefined);
|
||||
@@ -24,6 +24,7 @@ export function runInExternalTerminal(args: DebugProtocol.RunInTerminalRequestAr
|
||||
}
|
||||
}
|
||||
if (externalTerminalService) {
|
||||
const config = configProvider.getConfiguration('terminal');
|
||||
externalTerminalService.runInTerminal(args.title!, args.cwd, args.args, args.env || {}, config.external || {});
|
||||
}
|
||||
}
|
||||
@@ -60,24 +61,25 @@ export function hasChildProcesses(processId: number): boolean {
|
||||
|
||||
const enum ShellType { cmd, powershell, bash }
|
||||
|
||||
export function prepareCommand(args: DebugProtocol.RunInTerminalRequestArguments, config: ITerminalSettings): string {
|
||||
export function prepareCommand(args: DebugProtocol.RunInTerminalRequestArguments, shell: string, configProvider: ExtHostConfigProvider): string {
|
||||
|
||||
let shellType: ShellType;
|
||||
let shellType = env.isWindows ? ShellType.cmd : ShellType.bash; // pick a good default
|
||||
|
||||
// get the shell configuration for the current platform
|
||||
let shell: string;
|
||||
const shell_config = config.integrated.shell;
|
||||
if (env.isWindows) {
|
||||
shell = shell_config.windows || getSystemShell(env.Platform.Windows);
|
||||
shellType = ShellType.cmd;
|
||||
} else if (env.isLinux) {
|
||||
shell = shell_config.linux || getSystemShell(env.Platform.Linux);
|
||||
shellType = ShellType.bash;
|
||||
} else if (env.isMacintosh) {
|
||||
shell = shell_config.osx || getSystemShell(env.Platform.Mac);
|
||||
shellType = ShellType.bash;
|
||||
} else {
|
||||
throw new Error('Unknown platform');
|
||||
if (shell) {
|
||||
|
||||
const config = configProvider.getConfiguration('terminal');
|
||||
|
||||
// get the shell configuration for the current platform
|
||||
const shell_config = config.integrated.shell;
|
||||
if (env.isWindows) {
|
||||
shell = shell_config.windows || getSystemShell(env.Platform.Windows);
|
||||
} else if (env.isLinux) {
|
||||
shell = shell_config.linux || getSystemShell(env.Platform.Linux);
|
||||
} else if (env.isMacintosh) {
|
||||
shell = shell_config.osx || getSystemShell(env.Platform.Mac);
|
||||
} else {
|
||||
throw new Error('Unknown platform');
|
||||
}
|
||||
}
|
||||
|
||||
// try to determine the shell type
|
||||
|
||||
Reference in New Issue
Block a user