[PATCH] lib: readline support ctrl-l to clear screen

Antony Pavlov antonynpavlov at gmail.com
Sun Nov 15 00:50:49 PST 2015


On Sun, 15 Nov 2015 09:01:19 +0800
Du Huanpeng <u74147 at 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 at 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 at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox


-- 
-- 
Best regards,
  Antony Pavlov



More information about the barebox mailing list