Skip to content

Commit e8edc53

Browse files
committed
Guard startRenderLoop() against duplicate animation frame loops
Add early return if animationFrameId is already set, preventing multiple concurrent RAF loops when resize() is called re-entrantly from an onResize listener.
1 parent a884a3d commit e8edc53

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

lib/terminal.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,6 +1149,7 @@ export class Terminal implements ITerminalCore {
11491149
* Start the render loop
11501150
*/
11511151
private startRenderLoop(): void {
1152+
if (this.animationFrameId) return; // already running
11521153
const loop = () => {
11531154
if (!this.isDisposed && this.isOpen) {
11541155
// Render using WASM's native dirty tracking

0 commit comments

Comments
 (0)