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

Diff for /src/usr.bin/tmux/cmd-find.c between version 1.62 and 1.63

version 1.62, 2018/05/03 16:56:59 version 1.63, 2018/05/04 08:21:42
Line 83 
Line 83 
         char                     tmp[256];          char                     tmp[256];
         long long                pid;          long long                pid;
         u_int                    session;          u_int                    session;
           struct session          *s;
   
         envent = environ_find(c->environ, "TMUX");          envent = environ_find(c->environ, "TMUX");
         if (envent == NULL)          if (envent == NULL)
Line 92 
Line 93 
                 return (NULL);                  return (NULL);
         if (pid != getpid())          if (pid != getpid())
                 return (NULL);                  return (NULL);
         log_debug("client %p TMUX %s (session @%u)", c, envent->value, session);          log_debug("%s: client %p TMUX %s (session $%u)", __func__, c,
         return (session_find_by_id(session));              envent->value, session);
   
           s = session_find_by_id(session);
           if (s != NULL)
                   log_debug("%s: session $%u still exists", __func__, s->id);
           return (s);
 }  }
   
 /* Find pane containing client if any. */  /* Find pane containing client if any. */
Line 109 
Line 115 
                 if (strcmp(wp->tty, c->ttyname) == 0)                  if (strcmp(wp->tty, c->ttyname) == 0)
                         break;                          break;
         }          }
           if (wp != NULL)
                   log_debug("%s: got pane %%%u (%s)", __func__, wp->id, wp->tty);
         return (wp);          return (wp);
 }  }
   
Line 167 
Line 175 
         struct session   *s_loop, *s;          struct session   *s_loop, *s;
         u_int             i;          u_int             i;
   
           log_debug("%s: %u sessions to try", __func__, ssize);
   
         s = NULL;          s = NULL;
         if (slist != NULL) {          if (slist != NULL) {
                 for (i = 0; i < ssize; i++) {                  for (i = 0; i < ssize; i++) {
Line 190 
Line 200 
         u_int             ssize;          u_int             ssize;
         struct session   *s;          struct session   *s;
   
           log_debug("%s: window is @%u", __func__, fs->w->id);
   
         ssize = 0;          ssize = 0;
         RB_FOREACH(s, sessions, &sessions) {          RB_FOREACH(s, sessions, &sessions) {
                 if (!session_has(s, fs->w))                  if (!session_has(s, fs->w))
Line 219 
Line 231 
 {  {
         struct winlink   *wl, *wl_loop;          struct winlink   *wl, *wl_loop;
   
           log_debug("%s: window is @%u", __func__, fs->w->id);
   
         wl = NULL;          wl = NULL;
         if (fs->s->curw != NULL && fs->s->curw->window == fs->w)          if (fs->s->curw != NULL && fs->s->curw->window == fs->w)
                 wl = fs->s->curw;                  wl = fs->s->curw;
Line 706 
Line 720 
 cmd_find_log_state(const char *prefix, struct cmd_find_state *fs)  cmd_find_log_state(const char *prefix, struct cmd_find_state *fs)
 {  {
         if (fs->s != NULL)          if (fs->s != NULL)
                 log_debug("%s: s=$%u", prefix, fs->s->id);                  log_debug("%s: s=$%u %s", prefix, fs->s->id, fs->s->name);
         else          else
                 log_debug("%s: s=none", prefix);                  log_debug("%s: s=none", prefix);
         if (fs->wl != NULL) {          if (fs->wl != NULL) {
Line 895 
Line 909 
                                 break;                                  break;
                 }                  }
                 if (wl != NULL) {                  if (wl != NULL) {
                           log_debug("%s: session $%u has pane %%%u", __func__,
                               s->id, wp->id);
   
                         fs->s = s;                          fs->s = s;
                         fs->wl = s->curw; /* use current session */                          fs->wl = s->curw; /* use current session */
                         fs->w = fs->wl->window;                          fs->w = fs->wl->window;

Legend:
Removed from v.1.62  
changed lines
  Added in v.1.63