Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions demo/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 4 additions & 1 deletion src/browser/Terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */ }
Comment on lines +518 to +521
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it 👍

if (!this._renderService.hasRenderer()) {
this._renderService.setRenderer(this._createRenderer());
}
Expand Down