Add CLEARSCREEN option to menus
This commit is contained in:
parent
bdeab02c79
commit
76e29141ce
8
menus.c
8
menus.c
@ -74,6 +74,7 @@ int menu_system(char *menufile) {
|
|||||||
int result;
|
int result;
|
||||||
int doquit = 0;
|
int doquit = 0;
|
||||||
char c;
|
char c;
|
||||||
|
int clearscreen = 0;
|
||||||
|
|
||||||
if (menufile[0] == '/') {
|
if (menufile[0] == '/') {
|
||||||
snprintf(buffer, PATH_MAX, "%s.mnu", menufile);
|
snprintf(buffer, PATH_MAX, "%s.mnu", menufile);
|
||||||
@ -201,6 +202,8 @@ int menu_system(char *menufile) {
|
|||||||
free(ansi_file);
|
free(ansi_file);
|
||||||
}
|
}
|
||||||
ansi_file = strdup(&buffer[9]);
|
ansi_file = strdup(&buffer[9]);
|
||||||
|
} else if (strncasecmp(buffer, "CLEARSCREEN", 11) == 0) {
|
||||||
|
clearscreen = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
fgets(buffer, 256, fptr);
|
fgets(buffer, 256, fptr);
|
||||||
@ -259,6 +262,11 @@ int menu_system(char *menufile) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (clearscreen) {
|
||||||
|
s_printf("\e[2J\e[1;1H");
|
||||||
|
}
|
||||||
|
|
||||||
if (do_lua_menu == 0) {
|
if (do_lua_menu == 0) {
|
||||||
if (ansi_file != NULL) {
|
if (ansi_file != NULL) {
|
||||||
s_displayansi(ansi_file);
|
s_displayansi(ansi_file);
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
ANSIFILE logoff
|
ANSIFILE logoff
|
||||||
|
CLEARSCREEN
|
||||||
|
|
||||||
HOTKEY Y
|
HOTKEY Y
|
||||||
COMMAND LOGOFF
|
COMMAND LOGOFF
|
||||||
|
Reference in New Issue
Block a user