summaryrefslogtreecommitdiffstats
path: root/tty-keys.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-12-14 10:43:41 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-12-14 10:43:41 +0000
commit30962cb2008a5f699bdf3e1da01a2554c53b8062 (patch)
tree9c41eb0a70338e181ed598140a6c8039a4943d3b /tty-keys.c
parent3f58cbaae91ac941c34bad3cb2447d6bcc541a2d (diff)
New server option, escape-time, to set the timeout used to detect if escapes
are alone or part of a function key or meta sequence.
Diffstat (limited to 'tty-keys.c')
-rw-r--r--tty-keys.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tty-keys.c b/tty-keys.c
index a88f9542..0ac1b43d 100644
--- a/tty-keys.c
+++ b/tty-keys.c
@@ -429,7 +429,7 @@ tty_keys_next(struct tty *tty)
const char *buf;
size_t len, size;
cc_t bspace;
- int key;
+ int key, delay;
buf = EVBUFFER_DATA(tty->event->input);
len = EVBUFFER_LENGTH(tty->event->input);
@@ -521,8 +521,9 @@ partial_key:
start_timer:
/* Start the timer and wait for expiry or more data. */
- tv.tv_sec = 0;
- tv.tv_usec = ESCAPE_PERIOD * 1000L;
+ delay = options_get_number(&global_options, "escape-time");
+ tv.tv_sec = delay / 1000;
+ tv.tv_usec = (delay % 1000) * 1000L;
evtimer_del(&tty->key_timer);
evtimer_set(&tty->key_timer, tty_keys_callback, tty);