[BACK]Return to server.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Diff for /src/usr.bin/tmux/server.c between version 1.39 and 1.40

version 1.39, 2009/09/20 14:58:12 version 1.40, 2009/09/22 12:38:10
Line 798 
Line 798 
         struct screen           *s;          struct screen           *s;
         struct timeval           tv;          struct timeval           tv;
         struct key_binding      *bd;          struct key_binding      *bd;
         int                      key, prefix, status, xtimeout;          struct keylist          *keylist;
         int                      mode;          int                      key, status, xtimeout, mode, isprefix;
           u_int                    i;
         u_char                   mouse[3];          u_char                   mouse[3];
   
         xtimeout = options_get_number(&c->session->options, "repeat-time");          xtimeout = options_get_number(&c->session->options, "repeat-time");
Line 811 
Line 812 
         }          }
   
         /* Process keys. */          /* Process keys. */
         prefix = options_get_number(&c->session->options, "prefix");          keylist = options_get_data(&c->session->options, "prefix");
         while (tty_keys_next(&c->tty, &key, mouse) == 0) {          while (tty_keys_next(&c->tty, &key, mouse) == 0) {
                 server_activity = time(NULL);                  server_activity = time(NULL);
   
Line 844 
Line 845 
                         continue;                          continue;
                 }                  }
   
                   /* Is this a prefix key? */
                   isprefix = 0;
                   for (i = 0; i < ARRAY_LENGTH(keylist); i++) {
                           if (key == ARRAY_ITEM(keylist, i)) {
                                   isprefix = 1;
                                   break;
                           }
                   }
   
                 /* No previous prefix key. */                  /* No previous prefix key. */
                 if (!(c->flags & CLIENT_PREFIX)) {                  if (!(c->flags & CLIENT_PREFIX)) {
                         if (key == prefix)                          if (isprefix)
                                 c->flags |= CLIENT_PREFIX;                                  c->flags |= CLIENT_PREFIX;
                         else {                          else {
                                 /* Try as a non-prefix key binding. */                                  /* Try as a non-prefix key binding. */
Line 864 
Line 874 
                         /* If repeating, treat this as a key, else ignore. */                          /* If repeating, treat this as a key, else ignore. */
                         if (c->flags & CLIENT_REPEAT) {                          if (c->flags & CLIENT_REPEAT) {
                                 c->flags &= ~CLIENT_REPEAT;                                  c->flags &= ~CLIENT_REPEAT;
                                 if (key == prefix)                                  if (isprefix)
                                         c->flags |= CLIENT_PREFIX;                                          c->flags |= CLIENT_PREFIX;
                                 else                                  else
                                         window_pane_key(wp, c, key);                                          window_pane_key(wp, c, key);
Line 875 
Line 885 
                 /* If already repeating, but this key can't repeat, skip it. */                  /* If already repeating, but this key can't repeat, skip it. */
                 if (c->flags & CLIENT_REPEAT && !bd->can_repeat) {                  if (c->flags & CLIENT_REPEAT && !bd->can_repeat) {
                         c->flags &= ~CLIENT_REPEAT;                          c->flags &= ~CLIENT_REPEAT;
                         if (key == prefix)                          if (isprefix)
                                 c->flags |= CLIENT_PREFIX;                                  c->flags |= CLIENT_PREFIX;
                         else                          else
                                 window_pane_key(wp, c, key);                                  window_pane_key(wp, c, key);

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.40