Skip to content

Commit f9717bc

Browse files
authored
Merge pull request #1670 from Tyriar/1669_linkifier_exception
Fallback on default color when linkifier can't find the character
2 parents 7ef18cc + f4bb4a2 commit f9717bc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Linkifier.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,11 @@ export class Linkifier extends EventEmitter implements ILinkifier {
220220
// Get cell color
221221
const line = this._terminal.buffer.lines.get(this._terminal.buffer.ydisp + rowIndex);
222222
const char = line.get(index);
223-
const attr: number = char[CHAR_DATA_ATTR_INDEX];
224-
const fg = (attr >> 9) & 0x1ff;
223+
let fg: number | undefined;
224+
if (char) {
225+
const attr: number = char[CHAR_DATA_ATTR_INDEX];
226+
fg = (attr >> 9) & 0x1ff;
227+
}
225228

226229
// Ensure the link is valid before registering
227230
if (matcher.validationCallback) {

0 commit comments

Comments
 (0)