=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-find.c,v retrieving revision 1.31 retrieving revision 1.32 diff -c -r1.31 -r1.32 *** src/usr.bin/tmux/cmd-find.c 2016/01/19 16:01:30 1.31 --- src/usr.bin/tmux/cmd-find.c 2016/03/03 14:14:46 1.32 *************** *** 1,4 **** ! /* $OpenBSD: cmd-find.c,v 1.31 2016/01/19 16:01:30 nicm Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-find.c,v 1.32 2016/03/03 14:14:46 nicm Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott *************** *** 401,406 **** --- 401,407 ---- cmd_find_get_session(struct cmd_find_state *fs, const char *session) { struct session *s, *s_loop; + struct client *c; log_debug("%s: %s", __func__, session); *************** *** 417,422 **** --- 418,430 ---- if (fs->s != NULL) return (0); + /* Look for as a client. */ + c = cmd_find_client(NULL, session, 1); + if (c != NULL && c->session != NULL) { + fs->s = c->session; + return (0); + } + /* Stop now if exact only. */ if (fs->flags & CMD_FIND_EXACT_SESSION) return (-1); *************** *** 1209,1215 **** const char *path; /* A NULL argument means the current client. */ ! if (target == NULL) { c = cmd_find_current_client(cmdq); if (c == NULL && !quiet) cmdq_error(cmdq, "no current client"); --- 1217,1223 ---- const char *path; /* A NULL argument means the current client. */ ! if (cmdq != NULL && target == NULL) { c = cmd_find_current_client(cmdq); if (c == NULL && !quiet) cmdq_error(cmdq, "no current client");