[ipxe-devel] [PATCH] Add clearscreen command
Marc Hammer
marchammer at arcor.de
Sat Feb 4 17:14:30 UTC 2012
An HTML attachment was scrubbed...
URL: <http://lists.ipxe.org/pipermail/ipxe-devel/attachments/20120204/7ed314f2/attachment.htm>
-------------- next part --------------
diff --git a/src/core/exec.c b/src/core/exec.c
index 4926119..d567bf3 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,31 @@ struct command exit_command __command = {
.exec = exit_exec,
};
+
+/**
+ * "cls" command
+ *
+ * @v argc Argument count
+ * @v argv Argument list
+ * @ret rc Return status code
+ */
+static int cls_exec ( int argc __unused, char **argv __unused ) {
+ stdscr->height = LINES;
+ stdscr->width = COLS;
+ move ( 0, 0 );
+ erase();
+ return 0;
+}
+
+/** "cls" command */
+struct command cls_command __command = {
+ .name = "cls",
+ .exec = cls_exec,
+};
+
+
+
+
/** "isset" options */
struct isset_options {};
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Add-cls-command.patch
URL: <http://lists.ipxe.org/pipermail/ipxe-devel/attachments/20120204/7ed314f2/attachment.ksh>
More information about the ipxe-devel
mailing list