Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/api/node/extHostTerminalService.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { generateUuid } from '../../../base/common/uuid.js';
7
import { IExtHostRpcService } from '../common/extHostRpcService.js';
8
import { BaseExtHostTerminalService, ExtHostTerminal, ITerminalInternalOptions } from '../common/extHostTerminalService.js';
9
import type * as vscode from 'vscode';
10
import { IExtHostCommands } from '../common/extHostCommands.js';
11
12
export class ExtHostTerminalService extends BaseExtHostTerminalService {
13
14
constructor(
15
@IExtHostCommands extHostCommands: IExtHostCommands,
16
@IExtHostRpcService extHostRpc: IExtHostRpcService
17
) {
18
super(true, extHostCommands, extHostRpc);
19
}
20
21
public createTerminal(name?: string, shellPath?: string, shellArgs?: string[] | string): vscode.Terminal {
22
return this.createTerminalFromOptions({ name, shellPath, shellArgs });
23
}
24
25
public createTerminalFromOptions(options: vscode.TerminalOptions, internalOptions?: ITerminalInternalOptions): vscode.Terminal {
26
const terminal = new ExtHostTerminal(this._proxy, generateUuid(), options, options.name);
27
this._terminals.push(terminal);
28
terminal.create(options, this._serializeParentTerminal(options, internalOptions));
29
return terminal.value;
30
}
31
}
32
33