Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function initialize(container: View) {
process.on('exit', exit);
global.console = bufferedConsole;
terminal.fullscreen(true);
terminal.grabInput({ mouse: 'motion' });
terminal.hideCursor();
terminal.once('key', (name: string) => {
if (name === 'CTRL_C') {
// Trigger 'exit' event, which will do the clean up.
process.exit(0);
}
});
const eventManager = new EventManager();
terminal.on('mouse', (name: string, data: MouseEvent) => {
if (name === 'MOUSE_LEFT_BUTTON_PRESSED') {
eventManager.propagateEvent(
EventTypes.MOUSE_LEFT_BUTTON_PRESSED,
export function exit(code: number = 0) {
terminal.grabInput(false);
terminal.hideCursor(false);
terminal.fullscreen(false);
flushConsole(terminal);
terminal.processExit(code);
}
function init(cb) {
term.fullscreen(true);
term.grabInput();
term.on('key', (key) => {
cb(keyBindings[key], key);
});
}
function setData(data) {
term.fullscreen(true);
status('Status ');
input = input.concat(data.split('\n'));
resetTerminal();
for (var i = 0; i < input.length; i++) {
if (input[i] === '') {
lastLine = i - 1;
break;
}
}
}
function close(str) {
term.fullscreen(false);
term.clear();
done(str);
}
term.grabInput();
function close() {
term.fullscreen(false);
}
export function enter(): void {
term.fullscreen()
}
const initialize = () => {
term.fullscreen()
term.nextLine(term.height - 4)
const response = gameState.createOrLoadGame()
if (response.mode === "load") {
_updateGameState(gameState.getCommandHistory())
}
term(response.feedback)
updateStatusBar()
}
const render = () => {
term.fullscreen();
term.inverse( padLine( 'Use the arrow keys and BACKSPACE to navigate, ENTER to select, and ESC to quit' ) );
term( '\n' );
term.bold( padLine( `--- ${ current.path } `, '-' ) );
if ( menu ) {
menu.abort();
}
menu = term.singleColumnMenu(
getMenu( current, term.height - 4 ),
{ selectedIndex: current.index },
( error, { selectedIndex } ) => {
const selectedDirectory = current.items[ selectedIndex ].name;
const selectedPath = path.resolve( current.path, selectedDirectory );
const stats = fs.statSync( selectedPath );