From: Hans de Goede <hdegoede@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-devel@nongnu.org, anthony@codemonkey.ws
Subject: Re: [Qemu-devel] [PATCH for-1.5] readline: Handle xterm escape sequences for Home/End keys
Date: Tue, 14 May 2013 12:26:04 +0200 [thread overview]
Message-ID: <5192113C.8090508@redhat.com> (raw)
In-Reply-To: <1368526554-15866-1-git-send-email-kwolf@redhat.com>
Hi,
Looks good, ack.
Regards,
Hans
On 05/14/2013 12:15 PM, Kevin Wolf wrote:
> This fixes the Home/End keys in the monitor using the GTK frontend.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> readline.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/readline.c b/readline.c
> index d6e04d4..1c0f7ee 100644
> --- a/readline.c
> +++ b/readline.c
> @@ -27,6 +27,7 @@
> #define IS_NORM 0
> #define IS_ESC 1
> #define IS_CSI 2
> +#define IS_SS3 3
>
> #undef printf
> #define printf do_not_use_printf
> @@ -397,6 +398,9 @@ void readline_handle_byte(ReadLineState *rs, int ch)
> if (ch == '[') {
> rs->esc_state = IS_CSI;
> rs->esc_param = 0;
> + } else if (ch == 'O') {
> + rs->esc_state = IS_SS3;
> + rs->esc_param = 0;
> } else {
> rs->esc_state = IS_NORM;
> }
> @@ -439,6 +443,17 @@ void readline_handle_byte(ReadLineState *rs, int ch)
> rs->esc_state = IS_NORM;
> the_end:
> break;
> + case IS_SS3:
> + switch(ch) {
> + case 'F':
> + readline_eol(rs);
> + break;
> + case 'H':
> + readline_bol(rs);
> + break;
> + }
> + rs->esc_state = IS_NORM;
> + break;
> }
> readline_update(rs);
> }
>
next prev parent reply other threads:[~2013-05-14 10:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-14 10:15 [Qemu-devel] [PATCH for-1.5] readline: Handle xterm escape sequences for Home/End keys Kevin Wolf
2013-05-14 10:26 ` Hans de Goede [this message]
2013-05-14 16:10 ` Anthony Liguori
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=5192113C.8090508@redhat.com \
--to=hdegoede@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.