mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
+10
-3
@@ -273,11 +273,18 @@ function createTerminal(): void {
|
||||
addons.fit.instance!.fit();
|
||||
typedTerm.loadAddon(addons.webgl.instance);
|
||||
setTimeout(() => {
|
||||
addTextureAtlas(addons.webgl.instance.textureAtlas);
|
||||
addons.webgl.instance.onChangeTextureAtlas(e => addTextureAtlas(e));
|
||||
if (addons.webgl.instance !== undefined) {
|
||||
addTextureAtlas(addons.webgl.instance.textureAtlas);
|
||||
addons.webgl.instance.onChangeTextureAtlas(e => addTextureAtlas(e));
|
||||
}
|
||||
}, 0);
|
||||
|
||||
term.open(terminalContainer);
|
||||
try { // try-catch to allow the demo to load if webgl is not supported
|
||||
term.open(terminalContainer);
|
||||
}
|
||||
catch {
|
||||
addons.webgl.instance = undefined;
|
||||
}
|
||||
term.focus();
|
||||
|
||||
addDomListener(paddingElement, 'change', setPadding);
|
||||
|
||||
@@ -515,7 +515,10 @@ export class Terminal extends CoreTerminal implements ITerminal {
|
||||
// Performance: Add viewport and helper elements from the fragment
|
||||
this.element.appendChild(fragment);
|
||||
|
||||
this._onWillOpen.fire(this.element);
|
||||
try {
|
||||
this._onWillOpen.fire(this.element);
|
||||
}
|
||||
catch { /* fails to load addon for some reason */ }
|
||||
if (!this._renderService.hasRenderer()) {
|
||||
this._renderService.setRenderer(this._createRenderer());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user