@@ -16,7 +16,7 @@ if ('WebAssembly' in window) {
1616 ImageAddon = imageAddon . ImageAddon ;
1717}
1818
19- import { Terminal , ITerminalOptions , type IDisposable , type ITheme , emitterCtor } from '@xterm/xterm' ;
19+ import { Terminal , ITerminalOptions , type IDisposable , type ITheme , sharedExports , ISharedExports } from '@xterm/xterm' ;
2020import { AttachAddon } from '@xterm/addon-attach' ;
2121import { ClipboardAddon } from '@xterm/addon-clipboard' ;
2222import { FitAddon } from '@xterm/addon-fit' ;
@@ -32,6 +32,7 @@ import { UnicodeGraphemesAddon } from '@xterm/addon-unicode-graphemes';
3232export interface IWindowWithTerminal extends Window {
3333 term : typeof Terminal ;
3434 Terminal : typeof Terminal ;
35+ sharedExports : ISharedExports ;
3536 AttachAddon ?: typeof AttachAddon ; // eslint-disable-line @typescript-eslint/naming-convention
3637 ClipboardAddon ?: typeof ClipboardAddon ; // eslint-disable-line @typescript-eslint/naming-convention
3738 FitAddon ?: typeof FitAddon ; // eslint-disable-line @typescript-eslint/naming-convention
@@ -44,8 +45,6 @@ export interface IWindowWithTerminal extends Window {
4445 Unicode11Addon ?: typeof Unicode11Addon ; // eslint-disable-line @typescript-eslint/naming-convention
4546 UnicodeGraphemesAddon ?: typeof UnicodeGraphemesAddon ; // eslint-disable-line @typescript-eslint/naming-convention
4647 LigaturesAddon ?: typeof LigaturesAddon ; // eslint-disable-line @typescript-eslint/naming-convention
47-
48- emitterCtor ?: typeof emitterCtor ;
4948}
5049declare let window : IWindowWithTerminal ;
5150
@@ -216,6 +215,7 @@ const createNewWindowButtonHandler: () => void = () => {
216215
217216if ( document . location . pathname === '/test' ) {
218217 window . Terminal = Terminal ;
218+ window . sharedExports = sharedExports ;
219219 window . AttachAddon = AttachAddon ;
220220 window . ClipboardAddon = ClipboardAddon ;
221221 window . FitAddon = FitAddon ;
@@ -228,8 +228,6 @@ if (document.location.pathname === '/test') {
228228 window . LigaturesAddon = LigaturesAddon ;
229229 window . WebLinksAddon = WebLinksAddon ;
230230 window . WebglAddon = WebglAddon ;
231-
232- window . emitterCtor = emitterCtor ;
233231} else {
234232 createTerminal ( ) ;
235233 document . getElementById ( 'dispose' ) . addEventListener ( 'click' , disposeRecreateButtonHandler ) ;
@@ -283,7 +281,8 @@ function createTerminal(): void {
283281 addons . serialize . instance = new SerializeAddon ( ) ;
284282 addons . fit . instance = new FitAddon ( ) ;
285283 addons . image . instance = new ImageAddon ( ) ;
286- addons . progress . instance = new ProgressAddon ( emitterCtor ) ;
284+ //addons.progress.instance = new ProgressAddon(Terminal as unknown as IXtermSharedImports);
285+ addons . progress . instance = new ProgressAddon ( sharedExports ) ;
287286 addons . unicodeGraphemes . instance = new UnicodeGraphemesAddon ( ) ;
288287 addons . clipboard . instance = new ClipboardAddon ( ) ;
289288 try { // try to start with webgl renderer (might throw on older safari/webkit)
@@ -664,6 +663,7 @@ function initAddons(term: Terminal): void {
664663 }
665664 if ( checkbox . checked ) {
666665 // HACK: Manually remove addons that cannot be changes
666+ // FIXME: re-enable this once done with the sharedExports
667667 //addon.instance = new (addon as IDemoAddon<Exclude<AddonType, 'attach'>>).ctor();
668668 try {
669669 term . loadAddon ( addon . instance ) ;
0 commit comments