mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
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;
|
||||
|
||||
this._setup();
|
||||
this._bufferService.reset();
|
||||
|
||||
// reattach
|
||||
this._customKeyEventHandler = customKeyEventHandler;
|
||||
|
||||
@@ -20,6 +20,7 @@ export class MockBufferService implements IBufferService {
|
||||
this.cols = cols;
|
||||
this.rows = rows;
|
||||
}
|
||||
reset(): void {}
|
||||
}
|
||||
|
||||
export class MockOptionsService implements IOptionsService {
|
||||
|
||||
@@ -18,15 +18,19 @@ export class BufferService implements IBufferService {
|
||||
public get buffer(): IBuffer { return this.buffers.active; }
|
||||
|
||||
constructor(
|
||||
optionsService: IOptionsService
|
||||
private _optionsService: IOptionsService
|
||||
) {
|
||||
this.cols = Math.max(optionsService.options.cols, MINIMUM_COLS);
|
||||
this.rows = Math.max(optionsService.options.rows, MINIMUM_ROWS);
|
||||
this.buffers = new BufferSet(optionsService, this);
|
||||
this.cols = Math.max(_optionsService.options.cols, MINIMUM_COLS);
|
||||
this.rows = Math.max(_optionsService.options.rows, MINIMUM_ROWS);
|
||||
this.buffers = new BufferSet(_optionsService, this);
|
||||
}
|
||||
|
||||
public resize(cols: number, rows: number): void {
|
||||
this.cols = cols;
|
||||
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
|
||||
|
||||
resize(cols: number, rows: number): void;
|
||||
reset(): void;
|
||||
}
|
||||
|
||||
export interface IOptionsService {
|
||||
|
||||
Reference in New Issue
Block a user