Remove Terminal.handleTitle dep
This commit is contained in:
+3
-1
@@ -236,6 +236,8 @@ export class InputHandler extends Disposable implements IInputHandler {
|
||||
public get onLineFeed(): IEvent<void> { return this._onLineFeed.event; }
|
||||
private _onScroll = new EventEmitter<number>();
|
||||
public get onScroll(): IEvent<number> { return this._onScroll.event; }
|
||||
private _onTitleChange = new EventEmitter<string>();
|
||||
public get onTitleChange(): IEvent<string> { return this._onTitleChange.event; }
|
||||
|
||||
constructor(
|
||||
private _terminal: IInputHandlingTerminal,
|
||||
@@ -2569,7 +2571,7 @@ export class InputHandler extends Disposable implements IInputHandler {
|
||||
*/
|
||||
public setTitle(data: string): void {
|
||||
this._windowTitle = data;
|
||||
this._terminal.handleTitle(data);
|
||||
this._onTitleChange.fire(data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -121,7 +121,7 @@ describe('Terminal', () => {
|
||||
assert.equal(e, 'title');
|
||||
done();
|
||||
});
|
||||
term.handleTitle('title');
|
||||
term.write('\x1b]2;title\x07');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
+1
-8
@@ -182,6 +182,7 @@ export class Terminal extends CoreTerminal implements ITerminal, IInputHandlingT
|
||||
this._inputHandler.onRequestReset(() => this.reset());
|
||||
this._inputHandler.onCursorMove(() => this._onCursorMove.fire());
|
||||
this._inputHandler.onLineFeed(() => this._onLineFeed.fire());
|
||||
this._inputHandler.onTitleChange(title => this._onTitleChange.fire(title));
|
||||
this.register(this._inputHandler);
|
||||
}
|
||||
|
||||
@@ -1353,14 +1354,6 @@ export class Terminal extends CoreTerminal implements ITerminal, IInputHandlingT
|
||||
// this._onData.fire(data);
|
||||
// }
|
||||
|
||||
/**
|
||||
* Emit the 'title' event and populate the given title.
|
||||
* @param title The title to populate in the event.
|
||||
*/
|
||||
public handleTitle(title: string): void {
|
||||
this._onTitleChange.fire(title);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset terminal.
|
||||
* Note: Calling this directly from JS is synchronous but does not clear
|
||||
|
||||
@@ -215,9 +215,6 @@ export class MockInputHandlingTerminal implements IInputHandlingTerminal {
|
||||
public handler(data: string): void {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
public handleTitle(title: string): void {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
}
|
||||
|
||||
export class MockBuffer implements IBuffer {
|
||||
|
||||
Vendored
+2
-1
@@ -29,7 +29,6 @@ export interface IInputHandlingTerminal {
|
||||
scroll(eraseAttr: IAttributeData, isWrapped?: boolean): void;
|
||||
is(term: string): boolean;
|
||||
resize(x: number, y: number): void;
|
||||
handleTitle(title: string): void;
|
||||
}
|
||||
|
||||
export interface ICompositionHelper {
|
||||
@@ -44,6 +43,8 @@ export interface ICompositionHelper {
|
||||
* Calls the parser and handles actions generated by the parser.
|
||||
*/
|
||||
export interface IInputHandler {
|
||||
onTitleChange: IEvent<string>;
|
||||
|
||||
parse(data: string | Uint8Array): void;
|
||||
print(data: Uint32Array, start: number, end: number): void;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user