Hello, I was in the mood to add a clear screen command to iPXE, so there is a patch included. Hope you like it.
Best regards, Marc
>From f54a9669bbaed5f9287a334780104d5c14573228 Mon Sep 17 00:00:00 2001 Date: Sun, 29 Jan 2012 13:56:52 +0100 Subject: [PATCH] Add clearscreen command --- src/core/exec.c | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/src/core/exec.c b/src/core/exec.c index 4926119..3ff5bff 100644 --- a/src/core/exec.c +++ b/src/core/exec.c @@ -23,6 +23,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include <stdlib.h> #include <stdio.h> #include <ctype.h> +#include <curses.h> #include <unistd.h> #include <getopt.h> #include <errno.h> @@ -460,6 +461,30 @@ struct command exit_command __command = { .exec = exit_exec, }; + +/** + * "clearscreen" command + * + * @v argc Argument count + * @v argv Argument list + * @ret rc Return status code + */ +static int clearscreen_exec ( int argc __unused, char **argv __unused ) { + initscr(); + erase(); + endwin(); + return 0; +} + +/** "clearscreen" command */ +struct command clearscreen_command __command = { + .name = "clearscreen", + .exec = clearscreen_exec, +}; + + + + /** "isset" options */ struct isset_options {}; -- 1.4.4.4
_______________________________________________ ipxe-devel mailing list ipxe-devel@lists.ipxe.org https://lists.ipxe.org/mailman/listinfo/ipxe-devel