From 6ab02b6682c0b693b3e4f9afcc2ab8775f804f0a Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 27 Mar 2012 14:39:46 -0700 Subject: menu: Make "menu clear" the default Make "menu clear" the default... it was sort of implicitly so at least for vesamenu when using the old system, since we would end up zapping the mode when any output happened, but that no longer is the case. Also move the cursor to the top of the screen. Signed-off-by: H. Peter Anvin --- com32/menu/menumain.c | 10 +++++++--- com32/menu/readconfig.c | 4 +++- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'com32') diff --git a/com32/menu/menumain.c b/com32/menu/menumain.c index 5b3f6bd1..a795cb2c 100644 --- a/com32/menu/menumain.c +++ b/com32/menu/menumain.c @@ -1108,7 +1108,7 @@ int main(int argc, char *argv[]) { const char *cmdline; struct menu *m; - int rows, cols; + int rows, cols, cursorrow; int i; (void)argc; @@ -1150,11 +1150,15 @@ int main(int argc, char *argv[]) local_cursor_enable(true); cmdline = run_menu(); - if (clearmenu) + if (clearmenu) { clear_screen(); + cursorrow = 1; + } else { + cursorrow = END_ROW; + } local_cursor_enable(false); - printf("\033[?25h\033[%d;1H\033[0m", END_ROW); + printf("\033[?25h\033[%d;1H\033[0m", cursorrow); if (cmdline) { execute(cmdline, KT_NONE); diff --git a/com32/menu/readconfig.c b/com32/menu/readconfig.c index 0ac2564a..8f9d2372 100644 --- a/com32/menu/readconfig.c +++ b/com32/menu/readconfig.c @@ -35,7 +35,7 @@ struct menu *root_menu, *start_menu, *hide_menu, *menu_list; /* These are global parameters regardless of which menu we're displaying */ int shiftkey = 0; /* Only display menu if shift key pressed */ int hiddenmenu = 0; -int clearmenu = 0; +int clearmenu = 1; long long totaltimeout = 0; const char *hide_key[KEY_MAX]; @@ -744,6 +744,8 @@ static void parse_config_file(FILE * f) refstr_put(command); } else if ((ep = looking_at(p, "clear"))) { clearmenu = 1; + } else if ((ep = looking_at(p, "noclear"))) { + clearmenu = 0; } else if ((ep = is_message_name(p, &msgnr))) { refstr_put(m->messages[msgnr]); m->messages[msgnr] = refstrdup(skipspace(ep)); -- cgit v1.2.1