From 5bccc5eff0aeaa809a82d7d5266d01f661fb6b1b Mon Sep 17 00:00:00 2001 From: jpoth Date: Thu, 12 Apr 2018 13:27:27 +0200 Subject: [PATCH] Check if charMeasure is defined in headless mode --- src/Terminal.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Terminal.ts b/src/Terminal.ts index 3144ae9305..97fd0f8c8f 100644 --- a/src/Terminal.ts +++ b/src/Terminal.ts @@ -1927,8 +1927,10 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT if (x === this.cols && y === this.rows) { // Check if we still need to measure the char size (fixes #785). - if (!this.charMeasure.width || !this.charMeasure.height) { - this.charMeasure.measure(this.options); + if (this.charMeasure) { + if (!this.charMeasure.width || !this.charMeasure.height) { + this.charMeasure.measure(this.options); + } } return; }