Re: [ipxe-devel] [PATCH] Add clearscreen command

2012-01-30 Thread Robin Smidsrød
On 29.01.2012 14:17, Marc Hammer wrote:
> I was in the mood to add a clear screen command to iPXE, so there is a
> patch included.
> Hope you like it.

I would've preferred it to be named "cls" or "clear", to be honest. But
nice work, indeed!

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


Re: [ipxe-devel] [PATCH] Add clearscreen command

2012-01-30 Thread Marc Hammer

> I would've preferred it to be named "cls" or "clear", to be honest. But
> nice work, indeed!
>
> -- Robin
>   
The command "clear" allready exists ( http://ipxe.org/cmd ).
But "cls" would be possible.
If someone would like to rename the command, simple replace all
occurrence of "clearscreen" in the patch with eg. "cls".

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


Re: [ipxe-devel] [PATCH] Add clearscreen command

2012-01-30 Thread Christopher Barry
On Mon, 2012-01-30 at 19:18 +0100, Marc Hammer wrote:
> > I would've preferred it to be named "cls" or "clear", to be honest. But
> > nice work, indeed!
> >
> > -- Robin
> >   
> The command "clear" allready exists ( http://ipxe.org/cmd ).
> But "cls" would be possible.
> If someone would like to rename the command, simple replace all
> occurrence of "clearscreen" in the patch with eg. "cls".

Just a thought, but ctrl-l is the typical key combo to accomplish this
task.

-C

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


Re: [ipxe-devel] [PATCH] Add clearscreen command

2012-01-30 Thread Robin Smidsrød
On 30.01.2012 19:28, Christopher Barry wrote:
> On Mon, 2012-01-30 at 19:18 +0100, Marc Hammer wrote:
>>> I would've preferred it to be named "cls" or "clear", to be honest. But
>>> nice work, indeed!
>>>
>>> -- Robin
>>>   
>> The command "clear" allready exists ( http://ipxe.org/cmd ).
>> But "cls" would be possible.
>> If someone would like to rename the command, simple replace all
>> occurrence of "clearscreen" in the patch with eg. "cls".
> 
> Just a thought, but ctrl-l is the typical key combo to accomplish this
> task.

It would be awesome if Ctrl-L was bound to this command, then. +1 from
me for that.

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


Re: [ipxe-devel] [PATCH] Add clearscreen command

2012-01-31 Thread Andrew Bobulsky
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"  wrote:

> On 30.01.2012 19:28, Christopher Barry wrote:
>> On Mon, 2012-01-30 at 19:18 +0100, Marc Hammer wrote:
 I would've preferred it to be named "cls" or "clear", to be honest. But
 nice work, indeed!

 -- Robin

>>> The command "clear" allready exists ( http://ipxe.org/cmd ).
>>> But "cls" would be possible.
>>> If someone would like to rename the command, simple replace all
>>> occurrence of "clearscreen" in the patch with eg. "cls".
>>
>> Just a thought, but ctrl-l is the typical key combo to accomplish this
>> task.
>
> It would be awesome if Ctrl-L was bound to this command, then. +1 from
> me for that.
>
> -- Robin
> ___
> ipxe-devel mailing list
> ipxe-devel@lists.ipxe.org
> https://lists.ipxe.org/mailman/listinfo/ipxe-devel
___
ipxe-devel mailing list
ipxe-devel@lists.ipxe.org
https://lists.ipxe.org/mailman/listinfo/ipxe-devel


Re: [ipxe-devel] [PATCH] Add clearscreen command

2012-02-01 Thread Marc Hammer
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"  wrote:
>
>   

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


Re: [ipxe-devel] [PATCH] Add clearscreen command

2012-02-04 Thread Marc Hammer




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"  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 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -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


Re: [ipxe-devel] [PATCH] Add clearscreen command

2012-02-10 Thread Michael Brown
On Saturday 04 Feb 2012 17:14:30 Marc Hammer wrote:
> 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.

You can use ANSI escape sequences to clear the screen.  For example:

  set esc:hex 1b
  set cls ${esc}[2J
  echo ${cls}

I think a separate "cls" command is difficult to justify, given the overall 
code 
size constraints.  Thoughts?

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


Re: [ipxe-devel] [PATCH] Add clearscreen command

2012-02-10 Thread Miller, Shao
Agreed.  I'd more more forgiving for an 'alias' command where someone
could define their own commands. :)  Then 'cls' could be defined via
script.  - Shao

-Original Message-
From: ipxe-devel-boun...@lists.ipxe.org
[mailto:ipxe-devel-boun...@lists.ipxe.org] On Behalf Of Michael Brown
Sent: Friday, February 10, 2012 16:14
To: ipxe-devel@lists.ipxe.org
Subject: Re: [ipxe-devel] [PATCH] Add clearscreen command

On Saturday 04 Feb 2012 17:14:30 Marc Hammer wrote:
> 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.

You can use ANSI escape sequences to clear the screen.  For example:

  set esc:hex 1b
  set cls ${esc}[2J
  echo ${cls}

I think a separate "cls" command is difficult to justify, given the
overall code 
size constraints.  Thoughts?

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