diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-04-17 12:36:21 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-04-17 12:36:21 +0000 |
commit | 750b8106f71336cf5d871740f9cea792ce996a39 (patch) | |
tree | 8a31a0cd192359733fdab5bbdd18987cf5281dd5 /tty-keys.c | |
parent | 4898ee140f80001772a61a7befba38fac1a25c13 (diff) | |
download | rtmux-750b8106f71336cf5d871740f9cea792ce996a39.tar.gz rtmux-750b8106f71336cf5d871740f9cea792ce996a39.tar.bz2 rtmux-750b8106f71336cf5d871740f9cea792ce996a39.zip |
Remove the right number of characters from the buffer when escape then a cursor
key (or other key prefixed by \033) is pressed. Reported by Stuart Henderson.
Diffstat (limited to 'tty-keys.c')
-rw-r--r-- | tty-keys.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,4 +1,4 @@ -/* $Id: tty-keys.c,v 1.24 2009-03-02 18:05:40 nicm Exp $ */ +/* $Id: tty-keys.c,v 1.25 2009-04-17 12:36:21 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -299,13 +299,13 @@ tty_keys_next(struct tty *tty, int *key, u_char *mouse) if (len > 1) { tk = tty_keys_find(tty, buf + 1, len - 1, &size); if (tk != NULL) { - buffer_remove(tty->in, size + 1); + buffer_remove(tty->in, size + 2); *key = KEYC_ADDESC(tk->key); goto found; } } - /* If the timer hasn't expired, keep waiting . */ + /* If the timer hasn't expired, keep waiting. */ if (gettimeofday(&tv, NULL) != 0) fatal("gettimeofday"); if (timercmp(&tty->key_timer, &tv, >)) @@ -405,7 +405,7 @@ tty_keys_parse_xterm(struct tty *tty, char *buf, size_t len, size_t *size) key = KEYC_ADDESC(key); break; case '2': - key = KEYC_ADDSFT(key); + key = KEYC_ADDSFT(key); break; } |