How to use the terminal-kit.terminal.height function in terminal-kit

To help you get started, we’ve selected a few terminal-kit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / terminal-kit / terminal-kit-tests.ts View on Github external
}
);

const screen1 = new ScreenBuffer({ dst: term, noFill: true });

screen1.fill({
  attr: {
    // Both foreground and background must have the same color
    color: 0,
    bgColor: 0
  }
});

ScreenBuffer.loadImage(
  path_to_image,
  { terminal: term, shrink: { width: term.width, height: term.height * 2 } },
  (error: any, image: any) => {
    if (error) {
      throw error;
    } // Doh!

    image.draw({ dst: screen, blending: true });
    screen.draw();
  }
);
github guigrpa / oao / src / utils / parallelConsoleListener.js View on Github external
termInit() {
    /* eslint-disable no-console */
    for (let i = 0; i < term.height; i++) console.log('');
    /* eslint-enable no-console */
  }
github VertigoRay / GDAXBot / lib / terminal.js View on Github external
}



term.windowTitle(get_title());



// Clear Screen
term.clear();
b_main = tkit.ScreenBuffer.create({
	dst: term,
	x: 0,
	y: 0,
	width: term.width,
	height: term.height,
});

b_main.fill({
	attr: theme.main,
});

b_main.draw();



// Events
term.on('resize', (width, height) => {
	// console.log('TERM RESIZED:', width, height);
	load_layout(delta=false);
})
github brannondorsey / chattervox / src / ui / chat.ts View on Github external
export async function printReceivedMessage(message: MessageEvent, callsign: string): Promise {

    const pos: { x: number, y: number } = await term.getCursorLocation()
    if (pos) {
        term.moveTo(0, pos.y)
        term.insertLine(1)
        printStyledText(message)
        term.move(pos.x - 1, 0)

        if (term.height === pos.y) {
            if (input) {
                // term.moveTo(0, term.height)
                term.moveTo(0, term.height)
                myColorFunction(`${callsign}`)(': ')
                input.redraw()
            }
        }
    }
}
github VertigoRay / GDAXBot / lib / terminal.js View on Github external
});

		b_coin[product_id].fill({
			attr: theme.coins.container,
		});

		b_coin[product_id].draw({ delta: delta });

		i++;
	});


	b_footer = tkit.ScreenBuffer.create({
		dst: term,
		x: 1,
		y: term.height,
		width: term.width,
		height: 1,
		// blending: true,
		// noFill: true,
	});

	b_footer.fill({
		attr: theme.footer.container,
	});

	b_footer.draw({ delta: delta });
}
github guigrpa / storyboard / packages / storyboard-listener-console-parallel / src / index.js View on Github external
resetCursorPos() {
    if (!term.height) return;
    term.moveTo(1, this.height);
  }
}
github Automattic / wp-calypso / bin / analyze-css.js View on Github external
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 );

			if ( stats.isDirectory() ) {
				current = Folder( selectedPath );
			} else {
				current.index = selectedIndex;

				term.bell();
			}

			render();
		} );
github cronvel / terminal-kit / sample / single-column-menu-todoc2.js View on Github external
menu.on( 'submit' , data => {
	term.saveCursor() ;
	term.moveTo( 1 , term.height - 1 , "Submit: %s" , data.selectedText ) ;
	term.restoreCursor() ;
} ) ;