Revision: 2758
          http://tmux.svn.sourceforge.net/tmux/?rev=2758&view=rev
Author:   tcunha
Date:     2012-03-29 21:09:19 +0000 (Thu, 29 Mar 2012)
Log Message:
-----------
Sync OpenBSD patchset 1078:

Some terminals respond to secondary DA with primary (they ignore the
intermediate character). So ignore the possible responses to primary DA.

Modified Paths:
--------------
    trunk/tty-keys.c

Modified: trunk/tty-keys.c
===================================================================
--- trunk/tty-keys.c    2012-03-29 21:08:44 UTC (rev 2757)
+++ trunk/tty-keys.c    2012-03-29 21:09:19 UTC (rev 2758)
@@ -686,9 +686,9 @@
        char  tmp[64], *endptr;
 
        /*
-        * Secondary device attributes are \033[>a;b;c. We only request
-        * attributes on xterm, so we only care about the middle values which
-        * is the xterm version.
+        * Primary device attributes are \033[?a;b and secondary are
+        * \033[>a;b;c. We only request attributes on xterm, so we only care
+        * about the middle values which is the xterm version.
         */
 
        *size = 0;
@@ -702,7 +702,7 @@
                return (-1);
        if (len == 2)
                return (1);
-       if (buf[2] != '>')
+       if (buf[2] != '>' && buf[2] != '?')
                return (-1);
        if (len == 3)
                return (1);
@@ -718,6 +718,10 @@
        tmp[i] = '\0';
        *size = 4 + i;
 
+       /* Only secondary is of interest. */
+       if (buf[2] != '>')
+               return (0);
+
        /* Convert version numbers. */
        a = strtoul(tmp, &endptr, 10);
        if (*endptr == ';') {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs

Reply via email to