From 767eec3a2ca145c0e9a289835c8bc73e61c37ec4 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Thu, 6 Jun 2019 14:57:49 -0700 Subject: [PATCH 1/2] Properly clone default attr data on DECSTR Fixes #2196 --- src/InputHandler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/InputHandler.ts b/src/InputHandler.ts index 1a4ef187..57f866c9 100644 --- a/src/InputHandler.ts +++ b/src/InputHandler.ts @@ -1818,7 +1818,7 @@ export class InputHandler extends Disposable implements IInputHandler { this._terminal.applicationCursor = false; this._terminal.buffer.scrollTop = 0; this._terminal.buffer.scrollBottom = this._terminal.rows - 1; - this._terminal.curAttrData = DEFAULT_ATTR_DATA; + this._terminal.curAttrData = DEFAULT_ATTR_DATA.clone(); this._terminal.buffer.x = this._terminal.buffer.y = 0; // ? this._terminal.charset = null; this._terminal.glevel = 0; // ?? From d271095e288a5d23558a4ad06fccab22135b8942 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Thu, 6 Jun 2019 15:05:34 -0700 Subject: [PATCH 2/2] Freeze DEFAULT_ATTR_DATA to hard fail when not cloned --- src/core/buffer/BufferLine.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/buffer/BufferLine.ts b/src/core/buffer/BufferLine.ts index ce3b54b7..91c3a8d1 100644 --- a/src/core/buffer/BufferLine.ts +++ b/src/core/buffer/BufferLine.ts @@ -217,7 +217,7 @@ export class AttributeData implements IAttributeData { } } -export const DEFAULT_ATTR_DATA = new AttributeData(); +export const DEFAULT_ATTR_DATA = Object.freeze(new AttributeData()); /** * CellData - represents a single Cell in the terminal buffer.