diff --git a/html/src/components/terminal/xterm/index.ts b/html/src/components/terminal/xterm/index.ts index 402297a7..8a01598c 100644 --- a/html/src/components/terminal/xterm/index.ts +++ b/html/src/components/terminal/xterm/index.ts @@ -494,6 +494,9 @@ export class Xterm { try { this.terminal.loadAddon(this.canvasAddon); console.log('[ttyd] canvas renderer loaded'); + console.log('[ttyd] custom:ttydReady event dispatched'); + const customReady = new CustomEvent('custom:ttydReady'); + window.dispatchEvent(customReady); } catch (e) { console.log('[ttyd] canvas renderer could not be loaded, falling back to dom renderer', e); disposeCanvasRenderer(); @@ -509,13 +512,14 @@ export class Xterm { }); terminal.loadAddon(this.webglAddon); console.log('[ttyd] WebGL renderer loaded'); + console.log('[ttyd] custom:ttydReady event dispatched'); + const customReady = new CustomEvent('custom:ttydReady'); + window.dispatchEvent(customReady); } catch (e) { console.log('[ttyd] WebGL renderer could not be loaded, falling back to canvas renderer', e); disposeWebglRenderer(); enableCanvasRenderer(); } - const customReady = new CustomEvent('custom:ttydReady'); - window.dispatchEvent(customReady); }; switch (value) { @@ -529,6 +533,7 @@ export class Xterm { disposeWebglRenderer(); disposeCanvasRenderer(); console.log('[ttyd] dom renderer loaded'); + console.log('[ttyd] custom:ttydReady event dispatched'); break; default: break; diff --git a/html/src/template.html b/html/src/template.html index af23c054..0275d4a5 100644 --- a/html/src/template.html +++ b/html/src/template.html @@ -1,34 +1,41 @@ +
-