Files
xterm.js/addons/xterm-addon-webgl
Daniel Imms f0ddaf49ea Disable threshold check for glyphs with colored underlines
This causes some underlines to disappear which looks very bad for
colored underlines
2022-07-30 07:36:48 -07:00
..
2019-06-14 23:55:17 -07:00
2019-06-14 23:55:17 -07:00
2022-06-29 09:40:07 -07:00
2022-07-28 04:37:42 -07:00
2019-06-15 00:01:00 -07:00

xterm-addon-webgl

An addon for xterm.js that enables a WebGL2-based renderer. This addon requires xterm.js v4+.

Install

npm install --save xterm-addon-webgl

Usage

import { Terminal } from 'xterm';
import { WebglAddon } from 'xterm-addon-webgl';

const terminal = new Terminal();
terminal.open(element);
terminal.loadAddon(new WebglAddon());

See the full API for more advanced usage.

Handling Context Loss

The browser may drop WebGL contexts for various reasons like OOM or after the system has been suspended. There is an API exposed that fires the webglcontextlost event fired on the canvas so embedders can handle it however they wish. An easy, but suboptimal way, to handle this is by disposing of WebglAddon when the event fires:

const terminal = new Terminal();
const addon = new WebglAddon();
addon.onContextLoss(e => {
  addon.dispose();
});
terminal.loadAddon(addon);

Read more about handling WebGL context losses on the Khronos wiki.