--- Begin Message ---
[+tmux-users]

On 2014-04-29 17:51 +0000, daemianmack wrote:
> Yes, reverting that commit [c52548f6fd311e4df3076ba4cc6f6ab8849557ac]
> fixes the problem for me.

Although I still can't test it but I think I know what happens. That
commit contained this change:

diff --git a/xterm-keys.c b/xterm-keys.c
index 9b5a0a2..0e20165 100644
--- a/xterm-keys.c
+++ b/xterm-keys.c
@@ -131,7 +131,9 @@ xterm_keys_match(const char *template, const char *buf, 
size_t len)
 
        pos = 0;
        do {
-               if (*template != '_' && buf[pos] != *template)
+               if (*template == '_' && buf[pos] >= '1' && buf[pos] <= '8')
+                       continue;
+               if (buf[pos] != *template)
                        return (-1);
        } while (*++template != '\0' && ++pos != len);


You can see that we care only about values between 1 and 8. But it seems
that in iTerm2 you generate[1] a value with 9 and sometimes even with 10
if you press more modifiers[2]. You can take a look at "Solution 2" in
[1] as an interim solution. But before that, could you please verify
that things start to work if you replace that '8' above with a '9'?


Nick, I think this is a bug in tmux and is troublesome for iTerm2 users.
Would something along these lines work? Daemian, could you test this as
well (even things like M-S-up)? Thanks!

diff --git a/xterm-keys.c b/xterm-keys.c
index af3f1e7..489b64a 100644
--- a/xterm-keys.c
+++ b/xterm-keys.c
@@ -18,6 +18,7 @@
 
 #include <sys/types.h>
 
+#include <ctype.h>
 #include <string.h>
 
 #include "tmux.h"
@@ -131,10 +132,16 @@ xterm_keys_match(const char *template, const char *buf, 
size_t len)
 
        pos = 0;
        do {
-               if (*template == '_' && buf[pos] >= '1' && buf[pos] <= '8')
-                       continue;
-               if (buf[pos] != *template)
+               if (*template == '_') {
+                       if (!isdigit(buf[pos]))
+                               return -1;
+                       // Handle multidigit sequences like '\e[1;10A' for
+                       // M-S-up in iTerm2.
+                       while (pos+1 != len && isdigit(buf[pos+1]))
+                               pos += 1;
+               } else if (buf[pos] != *template) {
                        return (-1);
+               }
        } while (*++template != '\0' && ++pos != len);
 
        if (*template != '\0')  /* partial */


[1] http://stackoverflow.com/questions/10867199
[2] http://webframp.com/blog/2013/02/22/fixing-emacs-bindings-on-the-in-iterm2/

-- 
Balazs

--- End Message ---
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to