Path: blob/main/src/vs/workbench/api/node/extHostTerminalService.ts
3296 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { generateUuid } from '../../../base/common/uuid.js';6import { IExtHostRpcService } from '../common/extHostRpcService.js';7import { BaseExtHostTerminalService, ExtHostTerminal, ITerminalInternalOptions } from '../common/extHostTerminalService.js';8import type * as vscode from 'vscode';9import { IExtHostCommands } from '../common/extHostCommands.js';1011export class ExtHostTerminalService extends BaseExtHostTerminalService {1213constructor(14@IExtHostCommands extHostCommands: IExtHostCommands,15@IExtHostRpcService extHostRpc: IExtHostRpcService16) {17super(true, extHostCommands, extHostRpc);18}1920public createTerminal(name?: string, shellPath?: string, shellArgs?: string[] | string): vscode.Terminal {21return this.createTerminalFromOptions({ name, shellPath, shellArgs });22}2324public createTerminalFromOptions(options: vscode.TerminalOptions, internalOptions?: ITerminalInternalOptions): vscode.Terminal {25const terminal = new ExtHostTerminal(this._proxy, generateUuid(), options, options.name);26this._terminals.push(terminal);27terminal.create(options, this._serializeParentTerminal(options, internalOptions));28return terminal.value;29}30}313233