diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 3c5e57df42e..3782a6b9b78 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -152,53 +152,4 @@ declare module 'vscode' { */ export function registerDiffInformationCommand(command: string, callback: (diff: LineChange[], ...args: any[]) => any, thisArg?: any): Disposable; } - - export interface Terminal { - - /** - * The name of the terminal. - */ - readonly name: string; - - /** - * The process ID of the shell process. - */ - readonly processId: Thenable; - - /** - * Send text to the terminal. The text is written to the stdin of the underlying pty process - * (shell) of the terminal. - * - * @param text The text to send. - * @param addNewLine Whether to add a new line to the text being sent, this is normally - * required to run a command in the terminal. The character(s) added are \n or \r\n - * depending on the platform. This defaults to `true`. - */ - sendText(text: string, addNewLine?: boolean): void; - - /** - * Show the terminal panel and reveal this terminal in the UI. - * - * @param preserveFocus When `true` the terminal will not take focus. - */ - show(preserveFocus?: boolean): void; - - /** - * Hide the terminal panel if this terminal is currently showing. - */ - hide(): void; - - /** - * Dispose and free associated resources. - */ - dispose(): void; - - /** - * Experimental API that allows listening to the raw data stream coming from the terminal's - * pty process (including ANSI escape sequences). - * - * @param callback The callback that is triggered when data is sent to the terminal. - */ - onData(callback: (data: string) => any): void; - } } diff --git a/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts b/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts index c59fbbe5515..4c60bd2407e 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts @@ -24,7 +24,6 @@ export class MainThreadTerminalService extends MainThreadTerminalServiceShape { this._toDispose = []; this._toDispose.push(terminalService.onInstanceDisposed((terminalInstance) => this._onTerminalDisposed(terminalInstance))); this._toDispose.push(terminalService.onInstanceProcessIdReady((terminalInstance) => this._onTerminalProcessIdReady(terminalInstance))); - this._toDispose.push(terminalService.onInstanceData(event => this._onTerminalData(event.instance, event.data))); } public dispose(): void { @@ -56,13 +55,6 @@ export class MainThreadTerminalService extends MainThreadTerminalServiceShape { } } - public $registerOnData(terminalId: number): void { - let terminalInstance = this.terminalService.getInstanceFromId(terminalId); - if (terminalInstance) { - terminalInstance.enableApiOnData(); - } - } - public $dispose(terminalId: number): void { let terminalInstance = this.terminalService.getInstanceFromId(terminalId); if (terminalInstance) { @@ -84,8 +76,4 @@ export class MainThreadTerminalService extends MainThreadTerminalServiceShape { private _onTerminalProcessIdReady(terminalInstance: ITerminalInstance): void { this._proxy.$acceptTerminalProcessId(terminalInstance.id, terminalInstance.processId); } - - private _onTerminalData(terminalInstance: ITerminalInstance, data: string): void { - this._proxy.$acceptTerminalData(terminalInstance.id, data); - } } diff --git a/src/vs/workbench/api/node/extHost.protocol.ts b/src/vs/workbench/api/node/extHost.protocol.ts index 61e383fedc1..1437d4f91ef 100644 --- a/src/vs/workbench/api/node/extHost.protocol.ts +++ b/src/vs/workbench/api/node/extHost.protocol.ts @@ -262,7 +262,6 @@ export abstract class MainThreadTerminalServiceShape { $hide(terminalId: number): void { throw ni(); } $sendText(terminalId: number, text: string, addNewLine: boolean): void { throw ni(); } $show(terminalId: number, preserveFocus: boolean): void { throw ni(); } - $registerOnData(terminalId: number): void { throw ni(); } } export interface MyQuickPickItems extends IPickOpenEntry { @@ -486,7 +485,6 @@ export abstract class ExtHostQuickOpenShape { export abstract class ExtHostTerminalServiceShape { $acceptTerminalClosed(id: number): void { throw ni(); } $acceptTerminalProcessId(id: number, processId: number): void { throw ni(); } - $acceptTerminalData(id: number, data: string): void { throw ni(); } } export abstract class ExtHostSCMShape { diff --git a/src/vs/workbench/api/node/extHostTerminalService.ts b/src/vs/workbench/api/node/extHostTerminalService.ts index d3a5a42dc6f..2729f12071b 100644 --- a/src/vs/workbench/api/node/extHostTerminalService.ts +++ b/src/vs/workbench/api/node/extHostTerminalService.ts @@ -20,8 +20,6 @@ export class ExtHostTerminal implements vscode.Terminal { private _pidPromise: TPromise; private _pidPromiseComplete: TValueCallback; - private _onDataCallback: (data: string) => any; - constructor( proxy: MainThreadTerminalServiceShape, name?: string, @@ -69,11 +67,6 @@ export class ExtHostTerminal implements vscode.Terminal { this._queueApiRequest(this._proxy.$hide, []); } - public onData(callback: (data: string) => any): void { - this._onDataCallback = callback; - this._queueApiRequest(this._proxy.$registerOnData, []); - } - public dispose(): void { if (!this._disposed) { this._disposed = true; @@ -86,10 +79,6 @@ export class ExtHostTerminal implements vscode.Terminal { this._pidPromiseComplete = null; } - public _onData(data: string): void { - this._onDataCallback(data); - } - private _queueApiRequest(callback: (...args: any[]) => void, args: any[]) { let request: ApiRequest = new ApiRequest(callback, args); if (!this._id) { @@ -149,11 +138,6 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape { terminal._setProcessId(processId); } - public $acceptTerminalData(id: number, data: string): void { - let terminal = this._getTerminalById(id); - terminal._onData(data); - } - private _getTerminalById(id: number): ExtHostTerminal { let index = this._getTerminalIndexById(id); return index !== null ? this._terminals[index] : null; diff --git a/src/vs/workbench/parts/terminal/common/terminal.ts b/src/vs/workbench/parts/terminal/common/terminal.ts index c8c22a1ccd2..3d03cfbba78 100644 --- a/src/vs/workbench/parts/terminal/common/terminal.ts +++ b/src/vs/workbench/parts/terminal/common/terminal.ts @@ -358,11 +358,6 @@ export interface ITerminalInstance { */ reuseTerminal(shell?: IShellLaunchConfig): void; - /** - * Experimental: Call to enable onData to be passed over IPC to the extension host. - */ - enableApiOnData(): void; - /** * Sets the title of the terminal instance. */ diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts index c1894c983ad..8e683d8502e 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts @@ -822,11 +822,6 @@ export class TerminalInstance implements ITerminalInstance { }); } - public enableApiOnData(): void { - // Only send data through IPC if the API explicitly requests it. - this.onData(data => this._onDataForApi.fire({ instance: this, data })); - } - public static setTerminalProcessFactory(factory: ITerminalProcessFactory): void { this._terminalProcessFactory = factory; }