aboutsummaryrefslogtreecommitdiffstats
path: root/com32/menu
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2012-03-27 14:39:46 -0700
committerH. Peter Anvin <hpa@zytor.com>2012-03-27 14:39:46 -0700
commit6ab02b6682c0b693b3e4f9afcc2ab8775f804f0a (patch)
tree6dcc2cd05410d75e1d8f83eb0227932dfda9035d /com32/menu
parentcb05ff3e5a6aef2d1da2e4397b08e7eedde8c077 (diff)
downloadsyslinux-6ab02b6682c0b693b3e4f9afcc2ab8775f804f0a.tar.gz
syslinux-6ab02b6682c0b693b3e4f9afcc2ab8775f804f0a.tar.xz
syslinux-6ab02b6682c0b693b3e4f9afcc2ab8775f804f0a.zip
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 <hpa@zytor.com>
Diffstat (limited to 'com32/menu')
-rw-r--r--com32/menu/menumain.c10
-rw-r--r--com32/menu/readconfig.c4
2 files changed, 10 insertions, 4 deletions
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));