mirror of
https://github.com/tmate-io/tmate.git
synced 2025-08-19 01:46:33 +02:00
Sync OpenBSD patchset 587:
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.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $Id: tty-keys.c,v 1.53 2009-12-04 22:14:47 tcunha Exp $ */
|
||||
/* $Id: tty-keys.c,v 1.54 2009-12-16 01:09:01 tcunha 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);
|
||||
|
Reference in New Issue
Block a user