From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59169) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcCMz-0001Xz-CG for qemu-devel@nongnu.org; Tue, 14 May 2013 06:22:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UcCMy-0006n3-87 for qemu-devel@nongnu.org; Tue, 14 May 2013 06:22:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31074) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcCMy-0006mn-01 for qemu-devel@nongnu.org; Tue, 14 May 2013 06:22:08 -0400 Message-ID: <5192113C.8090508@redhat.com> Date: Tue, 14 May 2013 12:26:04 +0200 From: Hans de Goede MIME-Version: 1.0 References: <1368526554-15866-1-git-send-email-kwolf@redhat.com> In-Reply-To: <1368526554-15866-1-git-send-email-kwolf@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-1.5] readline: Handle xterm escape sequences for Home/End keys List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, anthony@codemonkey.ws 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 > --- > 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); > } >