mainThreadTerminalService.ts 1.0 KB
Newer Older
D
Daniel Imms 已提交
1 2 3 4 5 6
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
'use strict';

7
import {TPromise} from 'vs/base/common/winjs.base';
D
Daniel Imms 已提交
8 9 10 11 12 13 14 15 16 17 18 19 20
import {ITerminalService} from 'vs/workbench/parts/terminal/electron-browser/terminal';
import {MainThreadTerminalServiceShape} from './extHost.protocol';

export class MainThreadTerminalService extends MainThreadTerminalServiceShape {

	private _terminalService: ITerminalService;

	constructor(
		@ITerminalService terminalService: ITerminalService
	) {
		super();
		this._terminalService = terminalService;
	}
D
Daniel Imms 已提交
21

22
	public $createTerminal(name?: string): TPromise<number> {
D
Daniel Imms 已提交
23
		return this._terminalService.createNew(name);
D
Daniel Imms 已提交
24 25 26 27 28
	}

	public $show(terminalId: number, preserveFocus: boolean): void {
		this._terminalService.show(!preserveFocus, terminalId);
	}
D
Daniel Imms 已提交
29
}