diff options
author | 2009-12-14 10:43:41 +0000 | |
---|---|---|
committer | 2009-12-14 10:43:41 +0000 | |
commit | 298db98fdbfb7f3b4f506e8e4346cc85483c25ba (patch) | |
tree | 01ab32e210540f0fb63abca1275856f389e8b036 /usr.bin/tmux/tty-keys.c | |
parent | fuss about install msgs: new method state->ntogo, use it to annotate more (diff) | |
download | wireguard-openbsd-298db98fdbfb7f3b4f506e8e4346cc85483c25ba.tar.xz wireguard-openbsd-298db98fdbfb7f3b4f506e8e4346cc85483c25ba.zip |
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 'usr.bin/tmux/tty-keys.c')
-rw-r--r-- | usr.bin/tmux/tty-keys.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/tmux/tty-keys.c b/usr.bin/tmux/tty-keys.c index 9f2abbfb807..503456bc088 100644 --- a/usr.bin/tmux/tty-keys.c +++ b/usr.bin/tmux/tty-keys.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty-keys.c,v 1.27 2009/12/03 22:50:10 nicm Exp $ */ +/* $OpenBSD: tty-keys.c,v 1.28 2009/12/14 10:43:41 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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); |