Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Commit

Permalink
Patch linkifier to avoid upstream issue
Browse files Browse the repository at this point in the history
Summary:
xterm.js issue xtermjs/xterm.js#1669 made it into 3.7.0, which will throw frequent red boxes if it occurs.

Patch into the linkifier (again) with a try-catch until the issue is fixed upstream.

Reviewed By: kcaze

Differential Revision: D9804256

fbshipit-source-id: d707f3f257682bc17209e3956da0ea0c790ddb2c
  • Loading branch information
pelmers authored and facebook-github-bot committed Sep 13, 2018
1 parent 638ef12 commit dc6b0fc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions modules/atom-ide-ui/pkg/atom-ide-terminal/lib/createTerminal.js
Expand Up @@ -106,5 +106,16 @@ export function createTerminal(options: TerminalOptions = {}): Terminal {
...options,
}),
);
// Patch into xterm Linkifier to catch errors on out of bounds line fetching.
// Track issue at https://github.com/xtermjs/xterm.js/issues/1669
const linkifier = terminal._core.linkifier;
const doLinkifyRow = linkifier._doLinkifyRow;
linkifier._doLinkifyRow = (row, text, matcher, offset) => {
try {
doLinkifyRow.call(linkifier, row, text, matcher, offset);
} catch (e) {
// swallow errors to avoid red box because the linkifier runs on a timer.
}
};
return terminal;
}

0 comments on commit dc6b0fc

Please sign in to comment.