mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Clamp start and end in render service to ensure they're valid
Fixes #4314
This commit is contained in:
@@ -152,6 +152,14 @@ export class RenderService extends Disposable implements IRenderService {
|
||||
if (!this._renderer) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Since this is debounced, a resize event could have happened between the time a refresh was
|
||||
// requested and when this triggers. Clamp the values of start and end to ensure they're valid
|
||||
// given the current viewport state.
|
||||
start = Math.min(start, this._rowCount - 1);
|
||||
end = Math.min(end, this._rowCount - 1);
|
||||
|
||||
// Render
|
||||
this._renderer.renderRows(start, end);
|
||||
|
||||
// Update selection if needed
|
||||
|
||||
Reference in New Issue
Block a user