=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-find.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- src/usr.bin/tmux/cmd-find.c 2015/10/23 16:29:07 1.15 +++ src/usr.bin/tmux/cmd-find.c 2015/10/27 13:23:24 1.16 @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-find.c,v 1.15 2015/10/23 16:29:07 nicm Exp $ */ +/* $OpenBSD: cmd-find.c,v 1.16 2015/10/27 13:23:24 nicm Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott @@ -129,8 +129,8 @@ return (NULL); if (pid != getpid()) return (NULL); - log_debug("client %d TMUX is %s (session @%u)", c->ibuf.fd, - envent->value, session); + log_debug("client %p TMUX is %s (session @%u)", c, envent->value, + session); s = session_find_by_id(session); if (s == NULL || (w != NULL && !session_has(s, w))) @@ -333,6 +333,8 @@ { /* If we know the current client, use it. */ if (fs->cmdq->client != NULL) { + log_debug("%s: have client %p%s", __func__, fs->cmdq->client, + fs->cmdq->client->session == NULL ? "" : " (with session)"); if (fs->cmdq->client->session == NULL) return (cmd_find_current_session_with_client(fs)); fs->s = fs->cmdq->client->session; @@ -365,8 +367,11 @@ u_int csize; /* If the queue client has a session, use it. */ - if (cmdq->client != NULL && cmdq->client->session != NULL) + if (cmdq->client != NULL && cmdq->client->session != NULL) { + log_debug("%s: using cmdq %p client %p", __func__, cmdq, + cmdq->client); return (cmdq->client); + } /* Otherwise find the current session. */ cmd_find_clear_state(¤t, cmdq, 0); @@ -375,6 +380,7 @@ /* If it is attached, find the best of it's clients. */ s = current.s; + log_debug("%s: current session $%u %s", __func__, s->id, s->name); if (~s->flags & SESSION_UNATTACHED) { csize = 0; TAILQ_FOREACH(c, &clients, entry) { @@ -1220,6 +1226,7 @@ c = cmd_find_current_client(cmdq); if (c == NULL && !quiet) cmdq_error(cmdq, "no current client"); + log_debug("%s: no target, return %p", __func__, c); return (c); } copy = xstrdup(target); @@ -1251,6 +1258,7 @@ cmdq_error(cmdq, "can't find client %s", copy); free(copy); + log_debug("%s: target %s, return %p", __func__, target, c); return (c); }