88 * drifts across versions, so the sequence is a calibration knob, not a hardcoded
99 * assumption. Teams tune BUGBASH_KEYS/BUGBASH_ARGS per what the current TUI expects.
1010 */
11- import { resolve } from ' node:path' ;
11+ import { resolve } from " node:path" ;
1212
1313const dist = process . env . TUI_HARNESS_DIST ;
14- if ( ! dist ) throw new Error ( ' TUI_HARNESS_DIST must point at private-tui-harness dist/index.js' ) ;
14+ if ( ! dist ) throw new Error ( " TUI_HARNESS_DIST must point at private-tui-harness dist/index.js" ) ;
1515
1616const { TuiSession } = await import ( resolve ( dist ) ) ;
1717
18- const out = process . env . OUT || ' bug-bash.mp4' ;
19- const command = process . env . BUGBASH_CMD || ' bun' ;
20- const args = ( process . env . BUGBASH_ARGS || ' run src/index.ts' ) . split ( ' ' ) . filter ( Boolean ) ;
18+ const out = process . env . OUT || " bug-bash.mp4" ;
19+ const command = process . env . BUGBASH_CMD || " bun" ;
20+ const args = ( process . env . BUGBASH_ARGS || " run src/index.ts" ) . split ( " " ) . filter ( Boolean ) ;
2121// Semicolon-separated steps sent in order; each is text or a special key name
2222// understood by tui-harness (enter, down, up, escape, q, ctrl+c, ...).
23- const keys = ( process . env . BUGBASH_KEYS || ' down;down;enter;escape;q' ) . split ( ';' ) . filter ( Boolean ) ;
23+ const keys = ( process . env . BUGBASH_KEYS || " down;down;enter;escape;q" ) . split ( ";" ) . filter ( Boolean ) ;
2424const settleMs = Number ( process . env . BUGBASH_SETTLE_MS || 1500 ) ;
2525
2626const session = await TuiSession . launch ( {
@@ -29,17 +29,17 @@ const session = await TuiSession.launch({
2929 cwd : process . cwd ( ) ,
3030 cols : 140 ,
3131 rows : 40 ,
32- env : { CI : '1' , TERM : ' xterm-256color' } ,
32+ env : { CI : "1" , TERM : " xterm-256color" } ,
3333} ) ;
3434
3535session . startRecording ( ) ;
3636try {
37- await session . sendKeys ( '' , settleMs ) ; // let the first screen settle before driving
37+ await session . sendKeys ( "" , settleMs ) ; // let the first screen settle before driving
3838 for ( const k of keys ) {
3939 await session . sendKeys ( k , settleMs ) ;
4040 }
4141} finally {
4242 await session . stopRecording ( resolve ( out ) ) ;
43- await session . close ( ' SIGINT' ) . catch ( ( ) => { } ) ;
43+ await session . close ( " SIGINT" ) . catch ( ( ) => { } ) ;
4444 console . log ( `Recorded TUI session -> ${ out } ` ) ;
4545}
0 commit comments