@@ -16,7 +16,7 @@ if ('WebAssembly' in window) {
1616 ImageAddon = imageAddon . ImageAddon ;
1717}
1818
19- import { Terminal , ITerminalOptions , type IDisposable } from '@xterm/xterm' ;
19+ import { Terminal , ITerminalOptions , type IDisposable , type ITheme } from '@xterm/xterm' ;
2020import { AttachAddon } from '@xterm/addon-attach' ;
2121import { ClipboardAddon } from '@xterm/addon-clipboard' ;
2222import { FitAddon } from '@xterm/addon-fit' ;
@@ -131,7 +131,7 @@ const xtermjsTheme = {
131131 brightCyan : '#72F0FF' ,
132132 white : '#F8F8F8' ,
133133 brightWhite : '#FFFFFF'
134- } ;
134+ } satisfies ITheme ;
135135function setPadding ( ) : void {
136136 term . element . style . padding = parseInt ( paddingElement . value , 10 ) . toString ( ) + 'px' ;
137137 addons . fit . instance . fit ( ) ;
@@ -1266,9 +1266,9 @@ function addVtButtons(): void {
12661266
12671267 const element = document . createElement ( 'button' ) ;
12681268 element . textContent = name ;
1269- writeCsi . split ( '' ) ;
1270- const prefix = writeCsi . length === 2 ? writeCsi [ 0 ] : '' ;
1271- const suffix = writeCsi [ writeCsi . length - 1 ] ;
1269+ const writeCsiSplit = writeCsi . split ( '| ' ) ;
1270+ const prefix = writeCsiSplit . length === 2 ? writeCsiSplit [ 0 ] : '' ;
1271+ const suffix = writeCsiSplit [ writeCsiSplit . length - 1 ] ;
12721272 element . addEventListener ( `click` , ( ) => term . write ( csi ( `${ prefix } ${ inputs . map ( e => e . value ) . join ( ';' ) } ${ suffix } ` ) ) ) ;
12731273
12741274 const desc = document . createElement ( 'span' ) ;
@@ -1281,22 +1281,23 @@ function addVtButtons(): void {
12811281 }
12821282 const vtFragment = document . createDocumentFragment ( ) ;
12831283 const buttonSpecs : { [ key : string ] : { label : string , description : string , paramCount ?: number } } = {
1284- A : { label : 'CUU ↑' , description : 'Cursor Up Ps Times' } ,
1285- B : { label : 'CUD ↓' , description : 'Cursor Down Ps Times' } ,
1286- C : { label : 'CUF →' , description : 'Cursor Forward Ps Times' } ,
1287- D : { label : 'CUB ←' , description : 'Cursor Backward Ps Times' } ,
1288- E : { label : 'CNL' , description : 'Cursor Next Line Ps Times' } ,
1289- F : { label : 'CPL' , description : 'Cursor Preceding Line Ps Times' } ,
1290- G : { label : 'CHA' , description : 'Cursor Character Absolute' } ,
1291- H : { label : 'CUP' , description : 'Cursor Position [row;column]' , paramCount : 2 } ,
1292- I : { label : 'CHT' , description : 'Cursor Forward Tabulation Ps tab stops' } ,
1293- J : { label : 'ED' , description : 'Erase in Display' } ,
1294- '?J' : { label : 'DECSED' , description : 'Erase in Display' } ,
1295- K : { label : 'EL' , description : 'Erase in Line' } ,
1296- '?K' : { label : 'DECSEL' , description : 'Erase in Line' } ,
1297- L : { label : 'IL' , description : 'Insert Ps Line(s)' } ,
1298- M : { label : 'DL' , description : 'Delete Ps Line(s)' } ,
1299- P : { label : 'DCH' , description : 'Delete Ps Character(s)' }
1284+ A : { label : 'CUU ↑' , description : 'Cursor Up Ps Times' } ,
1285+ B : { label : 'CUD ↓' , description : 'Cursor Down Ps Times' } ,
1286+ C : { label : 'CUF →' , description : 'Cursor Forward Ps Times' } ,
1287+ D : { label : 'CUB ←' , description : 'Cursor Backward Ps Times' } ,
1288+ E : { label : 'CNL' , description : 'Cursor Next Line Ps Times' } ,
1289+ F : { label : 'CPL' , description : 'Cursor Preceding Line Ps Times' } ,
1290+ G : { label : 'CHA' , description : 'Cursor Character Absolute' } ,
1291+ H : { label : 'CUP' , description : 'Cursor Position [row;column]' , paramCount : 2 } ,
1292+ I : { label : 'CHT' , description : 'Cursor Forward Tabulation Ps tab stops' } ,
1293+ J : { label : 'ED' , description : 'Erase in Display' } ,
1294+ '?|J' : { label : 'DECSED' , description : 'Erase in Display' } ,
1295+ K : { label : 'EL' , description : 'Erase in Line' } ,
1296+ '?|K' : { label : 'DECSEL' , description : 'Erase in Line' } ,
1297+ L : { label : 'IL' , description : 'Insert Ps Line(s)' } ,
1298+ M : { label : 'DL' , description : 'Delete Ps Line(s)' } ,
1299+ P : { label : 'DCH' , description : 'Delete Ps Character(s)' } ,
1300+ ' q' : { label : 'DECSCUSR' , description : 'Set Cursor Style' , paramCount : 1 }
13001301 } ;
13011302 for ( const s of Object . keys ( buttonSpecs ) ) {
13021303 const spec = buttonSpecs [ s ] ;
0 commit comments