mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Du Huanpeng <u74147@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] lib: readline support ctrl-l to clear screen
Date: Tue, 17 Nov 2015 09:15:26 +0100	[thread overview]
Message-ID: <20151117081526.GM8526@pengutronix.de> (raw)
In-Reply-To: <1447549279-11694-1-git-send-email-u74147@gmail.com>

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

  parent reply	other threads:[~2015-11-17  8:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-15  1:01 Du Huanpeng
2015-11-15  8:50 ` Antony Pavlov
2015-11-17  8:15 ` Sascha Hauer [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-11-14 11:29 Du Huanpeng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151117081526.GM8526@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=u74147@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox