Its not as easy as I think it it to add a key combination.
So I only renamed the command to "cls" and set the cursor positon to screen top instead of  screen bottom.

-- Marc

Marc Hammer schrieb:
In first place the command was only intended for scripting.
I am also not quite sure how often the cli is used in a production
environment.

But if a key combination is wanted from a few users I will at least take
a look if its not to hard to implement.
If so I will update my patch.

-- Marc

Andrew Bobulsky schrieb:
  
I'm a fan (in concept) of a key combination, but my gut says its not
very necessary.

The last time I got very involved with a server/client scripting setup
(admittedly with gPXE), one of the problems I had was that, using
authenticated menus, you'd constantly see credentials being thrown
around in the GETs that were on lines above the initrds and kernels. A
scriptable clearscreen command handles that quite nicely :)

Regardless, I'm always a fan of simple, new features.

Cheers,
Andrew Bobulsky

On Jan 31, 2012, at 2:51 AM, "Robin Smidsrød" <ro...@smidsrod.no> wrote:

  
    
_______________________________________________
ipxe-devel mailing list
ipxe-devel@lists.ipxe.org
https://lists.ipxe.org/mailman/listinfo/ipxe-devel

  

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 {};
 
_______________________________________________
ipxe-devel mailing list
ipxe-devel@lists.ipxe.org
https://lists.ipxe.org/mailman/listinfo/ipxe-devel

Reply via email to