mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 17:48:56 +01:00
@@ -23,8 +23,10 @@ import { SignService } from 'vs/platform/sign/node/signService';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { AbstractVariableResolverService } from 'vs/workbench/services/configurationResolver/common/variableResolver';
|
||||
import { createCancelablePromise, firstParallel } from 'vs/base/common/async';
|
||||
import { hasChildProcesses, prepareCommand, runInExternalTerminal } from 'vs/workbench/contrib/debug/node/terminals';
|
||||
import { hasChildProcesses, prepareCommand } from 'vs/workbench/contrib/debug/node/terminals';
|
||||
import { IExtHostEditorTabs } from 'vs/workbench/api/common/extHostEditorTabs';
|
||||
import { IExternalTerminalService } from 'vs/platform/externalTerminal/common/externalTerminal';
|
||||
import { WindowsExternalTerminalService, MacExternalTerminalService, LinuxExternalTerminalService } from 'vs/platform/externalTerminal/node/externalTerminalService';
|
||||
|
||||
export class ExtHostDebugService extends ExtHostDebugServiceBase {
|
||||
|
||||
@@ -157,6 +159,24 @@ export class ExtHostDebugService extends ExtHostDebugServiceBase {
|
||||
}
|
||||
}
|
||||
|
||||
let externalTerminalService: IExternalTerminalService | undefined = undefined;
|
||||
|
||||
export function runInExternalTerminal(args: DebugProtocol.RunInTerminalRequestArguments, configProvider: ExtHostConfigProvider): Promise<number | undefined> {
|
||||
if (!externalTerminalService) {
|
||||
if (platform.isWindows) {
|
||||
externalTerminalService = new WindowsExternalTerminalService();
|
||||
} else if (platform.isMacintosh) {
|
||||
externalTerminalService = new MacExternalTerminalService();
|
||||
} else if (platform.isLinux) {
|
||||
externalTerminalService = new LinuxExternalTerminalService();
|
||||
} else {
|
||||
throw new Error('external terminals not supported on this platform');
|
||||
}
|
||||
}
|
||||
const config = configProvider.getConfiguration('terminal');
|
||||
return externalTerminalService.runInTerminal(args.title!, args.cwd, args.args, args.env || {}, config.external || {});
|
||||
}
|
||||
|
||||
class DebugTerminalCollection {
|
||||
/**
|
||||
* Delay before a new terminal is a candidate for reuse. See #71850
|
||||
|
||||
Reference in New Issue
Block a user