=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-find.c,v retrieving revision 1.64 retrieving revision 1.65 diff -u -r1.64 -r1.65 --- src/usr.bin/tmux/cmd-find.c 2018/05/09 07:50:03 1.64 +++ src/usr.bin/tmux/cmd-find.c 2018/05/28 11:50:47 1.65 @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-find.c,v 1.64 2018/05/09 07:50:03 nicm Exp $ */ +/* $OpenBSD: cmd-find.c,v 1.65 2018/05/28 11:50:47 nicm Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott @@ -112,7 +112,7 @@ return (NULL); RB_FOREACH(wp, window_pane_tree, &all_window_panes) { - if (strcmp(wp->tty, c->ttyname) == 0) + if (wp->fd != -1 && strcmp(wp->tty, c->ttyname) == 0) break; } if (wp != NULL) @@ -223,7 +223,7 @@ } /* - * Find the best winlink for a window (the current if it contains the pane, + * Find the best winlink for a window (the current if it contains the window, * otherwise the first). */ static int @@ -919,6 +919,10 @@ cmd_find_log_state(__func__, fs); return (0); + } + else { + log_debug("%s: session $%u does not have pane %%%u", + __func__, s->id, wp->id); } }