@@ -146,15 +146,27 @@ describe('SerializeAddon', () => {
146146 const cols = 10 ;
147147 const lines = newArray < string > ( ( index : number ) => digitsString ( cols , index ) , rows ) ;
148148 await writeSync ( page , lines . join ( '\\r\\n' ) ) ;
149- assert . equal ( await page . evaluate ( `serializeAddon.serialize(${ halfScrollback } );` ) , lines . slice ( halfScrollback , rows ) . join ( '\r\n' ) ) ;
149+ assert . equal ( await page . evaluate ( `serializeAddon.serialize({ scrollback: ${ halfScrollback } });` ) , lines . slice ( halfScrollback , rows ) . join ( '\r\n' ) ) ;
150150 } ) ;
151151
152152 it ( 'serialize 0 rows of scrollback' , async function ( ) : Promise < any > {
153153 const rows = 20 ;
154154 const cols = 10 ;
155155 const lines = newArray < string > ( ( index : number ) => digitsString ( cols , index ) , rows ) ;
156156 await writeSync ( page , lines . join ( '\\r\\n' ) ) ;
157- assert . equal ( await page . evaluate ( `serializeAddon.serialize(0);` ) , lines . slice ( rows - 10 , rows ) . join ( '\r\n' ) ) ;
157+ assert . equal ( await page . evaluate ( `serializeAddon.serialize({ scrollback: 0 });` ) , lines . slice ( rows - 10 , rows ) . join ( '\r\n' ) ) ;
158+ } ) ;
159+
160+ it ( 'serialize exclude modes' , async ( ) => {
161+ await writeSync ( page , 'before\\x1b[?1hafter' ) ;
162+ assert . equal ( await page . evaluate ( `serializeAddon.serialize();` ) , 'beforeafter\x1b[?1h' ) ;
163+ assert . equal ( await page . evaluate ( `serializeAddon.serialize({ excludeModes: true });` ) , 'beforeafter' ) ;
164+ } ) ;
165+
166+ it ( 'serialize exclude alt buffer' , async ( ) => {
167+ await writeSync ( page , 'normal\\x1b[?1049h\\x1b[Halt' ) ;
168+ assert . equal ( await page . evaluate ( `serializeAddon.serialize();` ) , 'normal\x1b[?1049h\x1b[Halt' ) ;
169+ assert . equal ( await page . evaluate ( `serializeAddon.serialize({ excludeAltBuffer: true });` ) , 'normal' ) ;
158170 } ) ;
159171
160172 it ( 'serialize all rows of content with color16' , async function ( ) : Promise < any > {
@@ -184,11 +196,13 @@ describe('SerializeAddon', () => {
184196 sgr ( UNDERLINED ) + line ,
185197 sgr ( BLINK ) + line ,
186198 sgr ( INVISIBLE ) + line ,
199+ sgr ( STRIKETHROUGH ) + line ,
187200 sgr ( NO_INVERSE ) + line ,
188201 sgr ( NO_BOLD ) + line ,
189202 sgr ( NO_UNDERLINED ) + line ,
190203 sgr ( NO_BLINK ) + line ,
191- sgr ( NO_INVISIBLE ) + line
204+ sgr ( NO_INVISIBLE ) + line ,
205+ sgr ( NO_STRIKETHROUGH ) + line
192206 ] ;
193207 const rows = lines . length ;
194208 await writeSync ( page , lines . join ( '\\r\\n' ) ) ;
@@ -579,20 +593,20 @@ const BG_RGB_GREEN = '48;2;0;255;0';
579593const BG_RGB_YELLOW = '48;2;255;255;0' ;
580594const BG_RESET = '49' ;
581595
582- const INVERSE = '7' ;
583596const BOLD = '1' ;
597+ const DIM = '2' ;
598+ const ITALIC = '3' ;
584599const UNDERLINED = '4' ;
585600const BLINK = '5' ;
601+ const INVERSE = '7' ;
586602const INVISIBLE = '8' ;
603+ const STRIKETHROUGH = '9' ;
587604
588- const NO_INVERSE = '27' ;
589605const NO_BOLD = '22' ;
606+ const NO_DIM = '22' ;
607+ const NO_ITALIC = '23' ;
590608const NO_UNDERLINED = '24' ;
591609const NO_BLINK = '25' ;
610+ const NO_INVERSE = '27' ;
592611const NO_INVISIBLE = '28' ;
593-
594- const ITALIC = '3' ;
595- const DIM = '2' ;
596-
597- const NO_ITALIC = '23' ;
598- const NO_DIM = '22' ;
612+ const NO_STRIKETHROUGH = '29' ;
0 commit comments