diff options
author | Tiago Cunha <tcunha@gmx.com> | 2009-12-02 15:06:35 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2009-12-02 15:06:35 +0000 |
commit | 97350cd883590a3dfaa3307446f3ca979134533d (patch) | |
tree | 4e637590168625bac425b3650a9730fac6dbdf0b /tty-keys.c | |
parent | 5081d7333064aecc188ffed1484f46bb2123b145 (diff) |
Sync OpenBSD patchset 575:
Handle partial xterm function key sequences.
Diffstat (limited to 'tty-keys.c')
-rw-r--r-- | tty-keys.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -1,4 +1,4 @@ -/* $Id: tty-keys.c,v 1.50 2009-11-28 14:51:37 tcunha Exp $ */ +/* $Id: tty-keys.c,v 1.51 2009-12-02 15:06:35 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -472,12 +472,15 @@ tty_keys_next(struct tty *tty) goto partial_key; } - /* Not found. Try to parse a key with an xterm-style modifier. */ - key = xterm_keys_find(buf, len, &size); - if (key != KEYC_NONE) { + switch (xterm_keys_find(buf, len, &size, &key)) { + case 0: /* found */ evbuffer_drain(tty->event->input, size); goto handle_key; + case -1: /* not found */ + break; + case 1: + goto partial_key; } /* Skip the escape. */ |