*/
#include "hdt-menu.h"
+#include <unistd.h>
int start_menu_mode(struct s_hardware *hardware, char *version_string)
{
/* Keyboard handler for the menu system */
void keys_handler(t_menuitem * mi, unsigned int scancode)
{
- char nc;
+ int nr, nc;
if ((scancode >> 8) == F1) { // If scancode of F1
runhelpsystem(mi->helpid);
*/
if (((scancode & 0xFF) == 0x09) && (mi->action == OPT_RUN)) {
//(isallowed(username,"editcmd") || isallowed(username,"root"))) {
- nc = getnumcols();
+ if (getscreensize(1, &nr, &nc)) {
+ /* Unknown screen size? */
+ nc = 80;
+ nr = 24;
+ }
/* User typed TAB and has permissions to edit command line */
gotoxy(EDITPROMPT, 1);
csprint("Command line:", 0x07);