Process ^[ as meta when a partial key is found.

pull/1/head
Nicholas Marriott 2013-03-25 11:44:16 +00:00
parent 43fb9835fa
commit e2295014d9
1 changed files with 8 additions and 1 deletions

View File

@ -82,6 +82,13 @@ const struct tty_default_key_raw tty_default_raw_keys[] = {
{ "\033[C", KEYC_RIGHT },
{ "\033[D", KEYC_LEFT },
/* Other (xterm) "cursor" keys. */
{ "\033OH", KEYC_HOME },
{ "\033OF", KEYC_END },
{ "\033[H", KEYC_HOME },
{ "\033[F", KEYC_END },
/* rxvt-style arrow + modifier keys. */
{ "\033Oa", KEYC_UP|KEYC_CTRL },
{ "\033Ob", KEYC_DOWN|KEYC_CTRL },
@ -491,6 +498,7 @@ tty_keys_next(struct tty *tty)
goto complete_key;
}
first_key:
/* Is this a meta key? */
if (len >= 2 && buf[0] == '\033') {
if (buf[1] != '\033') {
@ -511,7 +519,6 @@ tty_keys_next(struct tty *tty)
}
}
first_key:
/* No key found, take first. */
key = (u_char) *buf;
size = 1;