From f4bb4a22d4a6cdd1cdfa996c51ed477ef1a29e59 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Sat, 8 Sep 2018 13:01:59 -0700 Subject: [PATCH] Fallback on default color when linkifier can't find the character This probably doesn't fix the underlying problem, but it will make it obvious by using the white background color and more easily help identify the problem case. Fixes #1669 --- src/Linkifier.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Linkifier.ts b/src/Linkifier.ts index 8615daf8e7..6080c4aeac 100644 --- a/src/Linkifier.ts +++ b/src/Linkifier.ts @@ -220,8 +220,11 @@ export class Linkifier extends EventEmitter implements ILinkifier { // Get cell color const line = this._terminal.buffer.lines.get(this._terminal.buffer.ydisp + rowIndex); const char = line.get(index); - const attr: number = char[CHAR_DATA_ATTR_INDEX]; - const fg = (attr >> 9) & 0x1ff; + let fg: number | undefined; + if (char) { + const attr: number = char[CHAR_DATA_ATTR_INDEX]; + fg = (attr >> 9) & 0x1ff; + } // Ensure the link is valid before registering if (matcher.validationCallback) {