From 87f21f14a1f59286f272b22bc396d540d01ba636 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Wed, 4 Apr 2018 11:20:25 -0700 Subject: [PATCH 1/2] Remove unused options Fixes #897 --- src/Terminal.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Terminal.ts b/src/Terminal.ts index e441a5b4..cfbf8025 100644 --- a/src/Terminal.ts +++ b/src/Terminal.ts @@ -120,8 +120,6 @@ const DEFAULT_OPTIONS: ITerminalOptions = { tabStopWidth: 8, theme: null, rightClickSelectsWord: Browser.isMac - // programFeatures: false, - // focusKeys: false, }; export class Terminal extends EventEmitter implements ITerminal, IInputHandlingTerminal { From 82897ed56ce91695fc0b70a6ca4af8201c2bcb00 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 10 Apr 2018 19:54:49 -0700 Subject: [PATCH 2/2] Guard usages of DOM attached vars in setOption Fixes #1383 --- src/Terminal.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/Terminal.ts b/src/Terminal.ts index e441a5b4..1c424c6c 100644 --- a/src/Terminal.ts +++ b/src/Terminal.ts @@ -449,8 +449,10 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT case 'fontFamily': case 'fontSize': // When the font changes the size of the cells may change which requires a renderer clear - this.renderer.clear(); - this.charMeasure.measure(this.options); + if (this.renderer) { + this.renderer.clear(); + this.charMeasure.measure(this.options); + } break; case 'enableBold': case 'letterSpacing': @@ -458,12 +460,16 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT case 'fontWeight': case 'fontWeightBold': // When the font changes the size of the cells may change which requires a renderer clear - this.renderer.clear(); - this.renderer.onResize(this.cols, this.rows); - this.refresh(0, this.rows - 1); + if (this.renderer) { + this.renderer.clear(); + this.renderer.onResize(this.cols, this.rows); + this.refresh(0, this.rows - 1); + } case 'scrollback': this.buffers.resize(this.cols, this.rows); - this.viewport.syncScrollArea(); + if (this.viewport) { + this.viewport.syncScrollArea(); + } break; case 'screenReaderMode': if (value) {