mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] lib: readline support ctrl-l to clear screen
@ 2015-11-15  1:01 Du Huanpeng
  2015-11-15  8:50 ` Antony Pavlov
  2015-11-17  8:15 ` Sascha Hauer
  0 siblings, 2 replies; 4+ messages in thread
From: Du Huanpeng @ 2015-11-15  1:01 UTC (permalink / raw)
  To: barebox; +Cc: Du Huanpeng

maybe it is easier to press ctrl-l to clear the screen than type
'clear' command.

Signed-off-by: Du Huanpeng <u74147@gmail.com>
---
 lib/readline.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/readline.c b/lib/readline.c
index 14dd311..170effb 100644
--- a/lib/readline.c
+++ b/lib/readline.c
@@ -262,6 +262,15 @@ int readline(const char *prompt, char *buf, int len)
 				eol_num--;
 			}
 			break;
+		case CTL_CH('l'):
+			printf(ANSI_CLEAR_SCREEN);
+			buf[eol_num] = 0;
+			printf("%s%s", prompt, buf);
+			wlen = eol_num - num;
+			while (wlen--) {
+				getcmd_putch(CTL_BACKSPACE);
+			}
+			break;
 		case BB_KEY_ERASE_TO_EOL:
 			ERASE_TO_EOL();
 			break;
-- 
1.9.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] lib: readline support ctrl-l to clear screen
  2015-11-15  1:01 [PATCH] lib: readline support ctrl-l to clear screen Du Huanpeng
@ 2015-11-15  8:50 ` Antony Pavlov
  2015-11-17  8:15 ` Sascha Hauer
  1 sibling, 0 replies; 4+ messages in thread
From: Antony Pavlov @ 2015-11-15  8:50 UTC (permalink / raw)
  To: Du Huanpeng; +Cc: barebox

On Sun, 15 Nov 2015 09:01:19 +0800
Du Huanpeng <u74147@gmail.com> wrote:

You have submited at lease two patches with '[PATCH] lib: readline support ctrl-l to clear screen' subject.
The patches differ from each other. This causes causes a great deal of confusion.

Please add a version tag when resending patches, see this for details:
   http://wiki.qemu.org/Contribute/SubmitAPatch#When_resending_patches_add_a_version_tag

> maybe it is easier to press ctrl-l to clear the screen than type
> 'clear' command.
> 
> Signed-off-by: Du Huanpeng <u74147@gmail.com>
> ---
>  lib/readline.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/lib/readline.c b/lib/readline.c
> index 14dd311..170effb 100644
> --- a/lib/readline.c
> +++ b/lib/readline.c
> @@ -262,6 +262,15 @@ int readline(const char *prompt, char *buf, int len)
>  				eol_num--;
>  			}
>  			break;
> +		case CTL_CH('l'):
> +			printf(ANSI_CLEAR_SCREEN);
> +			buf[eol_num] = 0;
> +			printf("%s%s", prompt, buf);
> +			wlen = eol_num - num;
> +			while (wlen--) {
> +				getcmd_putch(CTL_BACKSPACE);
> +			}
> +			break;
>  		case BB_KEY_ERASE_TO_EOL:
>  			ERASE_TO_EOL();
>  			break;
> -- 
> 1.9.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox


-- 
-- 
Best regards,
  Antony Pavlov

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] lib: readline support ctrl-l to clear screen
  2015-11-15  1:01 [PATCH] lib: readline support ctrl-l to clear screen Du Huanpeng
  2015-11-15  8:50 ` Antony Pavlov
@ 2015-11-17  8:15 ` Sascha Hauer
  1 sibling, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2015-11-17  8:15 UTC (permalink / raw)
  To: Du Huanpeng; +Cc: barebox

On Sun, Nov 15, 2015 at 09:01:19AM +0800, Du Huanpeng wrote:
> maybe it is easier to press ctrl-l to clear the screen than type
> 'clear' command.
> 
> Signed-off-by: Du Huanpeng <u74147@gmail.com>
> ---
>  lib/readline.c | 9 +++++++++
>  1 file changed, 9 insertions(+)

Applied, thanks. Antony is right, please explain the changes to the last
version next time.

Sascha

> 
> diff --git a/lib/readline.c b/lib/readline.c
> index 14dd311..170effb 100644
> --- a/lib/readline.c
> +++ b/lib/readline.c
> @@ -262,6 +262,15 @@ int readline(const char *prompt, char *buf, int len)
>  				eol_num--;
>  			}
>  			break;
> +		case CTL_CH('l'):
> +			printf(ANSI_CLEAR_SCREEN);
> +			buf[eol_num] = 0;
> +			printf("%s%s", prompt, buf);
> +			wlen = eol_num - num;
> +			while (wlen--) {
> +				getcmd_putch(CTL_BACKSPACE);
> +			}
> +			break;
>  		case BB_KEY_ERASE_TO_EOL:
>  			ERASE_TO_EOL();
>  			break;
> -- 
> 1.9.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] lib: readline support ctrl-l to clear screen
@ 2015-11-14 11:29 Du Huanpeng
  0 siblings, 0 replies; 4+ messages in thread
From: Du Huanpeng @ 2015-11-14 11:29 UTC (permalink / raw)
  To: barebox; +Cc: Du Huanpeng

maybe it is easier to press ctrl-l to clear the screen than type
'clear' command.

Signed-off-by: Du Huanpeng <u74147@gmail.com>
---
 lib/readline.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/readline.c b/lib/readline.c
index 14dd311..679d78f 100644
--- a/lib/readline.c
+++ b/lib/readline.c
@@ -262,6 +262,10 @@ int readline(const char *prompt, char *buf, int len)
 				eol_num--;
 			}
 			break;
+		case CTL_CH('l'):
+			printf(ANSI_CLEAR_SCREEN);
+			printf("%s%s", prompt, buf);
+			break;
 		case BB_KEY_ERASE_TO_EOL:
 			ERASE_TO_EOL();
 			break;
-- 
1.9.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-11-17  8:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-15  1:01 [PATCH] lib: readline support ctrl-l to clear screen Du Huanpeng
2015-11-15  8:50 ` Antony Pavlov
2015-11-17  8:15 ` Sascha Hauer
  -- strict thread matches above, loose matches on Subject: below --
2015-11-14 11:29 Du Huanpeng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox