Properly reset buffer after Terminal.reset
This commit is contained in:
@@ -1893,6 +1893,7 @@ export class Terminal extends EventEmitter implements ITerminal, IDisposable, II
|
|||||||
const userScrolling = this._userScrolling;
|
const userScrolling = this._userScrolling;
|
||||||
|
|
||||||
this._setup();
|
this._setup();
|
||||||
|
this._bufferService.reset();
|
||||||
|
|
||||||
// reattach
|
// reattach
|
||||||
this._customKeyEventHandler = customKeyEventHandler;
|
this._customKeyEventHandler = customKeyEventHandler;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ export class MockBufferService implements IBufferService {
|
|||||||
this.cols = cols;
|
this.cols = cols;
|
||||||
this.rows = rows;
|
this.rows = rows;
|
||||||
}
|
}
|
||||||
|
reset(): void {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class MockOptionsService implements IOptionsService {
|
export class MockOptionsService implements IOptionsService {
|
||||||
|
|||||||
@@ -18,15 +18,19 @@ export class BufferService implements IBufferService {
|
|||||||
public get buffer(): IBuffer { return this.buffers.active; }
|
public get buffer(): IBuffer { return this.buffers.active; }
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
optionsService: IOptionsService
|
private _optionsService: IOptionsService
|
||||||
) {
|
) {
|
||||||
this.cols = Math.max(optionsService.options.cols, MINIMUM_COLS);
|
this.cols = Math.max(_optionsService.options.cols, MINIMUM_COLS);
|
||||||
this.rows = Math.max(optionsService.options.rows, MINIMUM_ROWS);
|
this.rows = Math.max(_optionsService.options.rows, MINIMUM_ROWS);
|
||||||
this.buffers = new BufferSet(optionsService, this);
|
this.buffers = new BufferSet(_optionsService, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public resize(cols: number, rows: number): void {
|
public resize(cols: number, rows: number): void {
|
||||||
this.cols = cols;
|
this.cols = cols;
|
||||||
this.rows = rows;
|
this.rows = rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public reset(): void {
|
||||||
|
this.buffers = new BufferSet(this._optionsService, this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
@@ -15,6 +15,7 @@ export interface IBufferService {
|
|||||||
// TODO: Move resize event here
|
// TODO: Move resize event here
|
||||||
|
|
||||||
resize(cols: number, rows: number): void;
|
resize(cols: number, rows: number): void;
|
||||||
|
reset(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IOptionsService {
|
export interface IOptionsService {
|
||||||
|
|||||||
Reference in New Issue
Block a user