Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"w": term.str.bgWhite() ,
"W": term.str.bgBrightWhite() ,
"y": term.str.bgYellow() ,
"Y": term.str.bgBrightYellow()
}
}
} ;
term.formatConfig.rawMarkupConfig = Object.create( term.formatConfig ) ;
term.formatConfig.rawMarkupConfig.startingMarkupReset = false ;
term.formatConfig.rawMarkupConfig.endingMarkupReset = false ;
for ( k in term.escHandler ) { term.formatConfig.fn[ k ] = term.escHandler[ k ] ; }
for ( k in term.escOffHandler ) { term.formatConfig.fn[ k + '_off' ] = term.escOffHandler[ k ] ; }
term.format = string.createFormatter( term.formatConfig ) ;
term.markup = string.createMarkup( term.formatConfig ) ;
term.options = options ;
// Should come after any escape sequence definitions
createOptimized( term ) ;
// Register various exit handler
// Fix the issue #3, turn grabInput off on exit
// Disable input grabbing at exit.
// Note: the terminal can still send some garbage if it was about to do it when exit kickin.
process.on( 'exit' , () => {
//console.log( '>>> exit' ) ;
// Cleanup was done from elsewhere, probably by .asyncCleanup()
if ( term.shutdown ) { return ; }
term.shutdown = true ;
return newStrArray ;
} ,
charWidthFn: char => {
if ( char[ 0 ] === '^' && char[ 1 ] ) {
if ( char[ 1 ] === '^' || char[ 1 ] === ' ' ) { return 1 ; }
return 0 ;
}
return string.unicode.charWidth( char ) ;
}
} ) ;
misc.preserveMarkupFormat = string.createFormatter( {
argumentSanitizer: str => str.replace( /[\x00-\x1f\x7f^]/g , char => char === '^' ? '^^' : '' ) ,
noMarkup: true
} ) ;
misc.markupOptions = {
complexMarkupAliases: {
c: 'color' ,
fg: 'color' ,
bg: 'bgColor'
} ,
shiftMarkup: {
'#': 'background'
} ,
markup: {