mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 18:19:12 +01:00
Starting API
This commit is contained in:
34
src/vs/workbench/api/node/extHostTerminalService.ts
Normal file
34
src/vs/workbench/api/node/extHostTerminalService.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 {IThreadService} from 'vs/workbench/services/thread/common/threadService';
|
||||
import vscode = require('vscode');
|
||||
import {MainContext, MainThreadTerminalServiceShape} from './extHost.protocol';
|
||||
|
||||
export class ExtHostTerminal implements vscode.Terminal {
|
||||
|
||||
public name: string;
|
||||
|
||||
private _proxy: MainThreadTerminalServiceShape;
|
||||
|
||||
constructor(proxy: MainThreadTerminalServiceShape, name?: string) {
|
||||
this.name = name;
|
||||
this._proxy = proxy;
|
||||
}
|
||||
}
|
||||
|
||||
export class ExtHostTerminalService {
|
||||
|
||||
private _proxy: MainThreadTerminalServiceShape;
|
||||
|
||||
constructor(threadService: IThreadService) {
|
||||
this._proxy = threadService.get(MainContext.MainThreadTerminalService);
|
||||
}
|
||||
|
||||
createTerminal(name?: string): vscode.Terminal {
|
||||
return new ExtHostTerminal(this._proxy, name);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user