Revision: 2776
http://tmux.svn.sourceforge.net/tmux/?rev=2776&view=rev
Author: tcunha
Date: 2012-04-24 16:17:57 +0000 (Tue, 24 Apr 2012)
Log Message:
-----------
Sync OpenBSD patchset 1094:
Handle partial keys properly by making sure the timer has actually
expired, fixes problems with mintty reported by Michael Simpson.
Modified Paths:
--------------
trunk/tty-keys.c
Modified: trunk/tty-keys.c
===================================================================
--- trunk/tty-keys.c 2012-04-12 12:44:26 UTC (rev 2775)
+++ trunk/tty-keys.c 2012-04-24 16:17:57 UTC (rev 2776)
@@ -476,7 +476,6 @@
goto partial_key;
}
-
/* Is this a mouse key press? */
switch (tty_keys_mouse(tty, buf, len, &size, &mouse)) {
case 0: /* yes */
@@ -532,10 +531,11 @@
partial_key:
/*
- * Escape but no key string. If have already seen an escape, then the
- * timer must have expired, so give up waiting and send the escape.
+ * Escape but no key string. If have already seen an escape and the
+ * timer has expired, give up waiting and send the escape.
*/
- if (tty->flags & TTY_ESCAPE) {
+ if ((tty->flags & TTY_ESCAPE) &&
+ !evtimer_pending(&tty->key_timer, NULL)) {
evbuffer_drain(tty->event->input, 1);
key = '\033';
goto handle_key;
@@ -544,6 +544,10 @@
/* Fall through to start the timer. */
start_timer:
+ /* If already waiting for timer, do nothing. */
+ if (evtimer_pending(&tty->key_timer, NULL))
+ return (0);
+
/* Start the timer and wait for expiry or more data. */
delay = options_get_number(&global_options, "escape-time");
tv.tv_sec = delay / 1000;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs