mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-25 15:35:43 +01:00
@@ -349,16 +349,6 @@ export interface ITerminalInstance {
|
||||
*/
|
||||
setVisible(visible: boolean): void;
|
||||
|
||||
/**
|
||||
* Attach a listener to the data stream from the terminal's pty process.
|
||||
*
|
||||
* @param listener The listener function which takes the processes' data stream (including
|
||||
* ANSI escape sequences).
|
||||
*
|
||||
* @deprecated onLineData will replace this.
|
||||
*/
|
||||
onData(listener: (data: string) => void): IDisposable;
|
||||
|
||||
/**
|
||||
* Attach a listener to listen for new lines added to this terminal instance.
|
||||
*
|
||||
|
||||
@@ -823,22 +823,6 @@ export class TerminalInstance implements ITerminalInstance {
|
||||
return env;
|
||||
}
|
||||
|
||||
public onData(listener: (data: string) => void): lifecycle.IDisposable {
|
||||
let callback = (message) => {
|
||||
if (message.type === 'data') {
|
||||
listener(message.content);
|
||||
}
|
||||
};
|
||||
this._process.on('message', callback);
|
||||
return {
|
||||
dispose: () => {
|
||||
if (this._process) {
|
||||
this._process.removeListener('message', callback);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public onLineData(listener: (lineData: string) => void): lifecycle.IDisposable {
|
||||
this._onLineDataListeners.push(listener);
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user