summaryrefslogtreecommitdiffstats
path: root/cmd-find.c
diff options
context:
space:
mode:
authornicm <nicm>2015-04-28 11:57:20 +0000
committernicm <nicm>2015-04-28 11:57:20 +0000
commit14d8cd64455e34c1c3f5803210e1162d4a03fb48 (patch)
treeb6c2ad1967005f9ed926b8df9a958e7bc4645c65 /cmd-find.c
parent094a047ddfe43817ac7f670668fd7d648349f6cd (diff)
Do not do a search for the tty path if there isn't one.
Diffstat (limited to 'cmd-find.c')
-rw-r--r--cmd-find.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/cmd-find.c b/cmd-find.c
index e937b6dc..e9d80cbe 100644
--- a/cmd-find.c
+++ b/cmd-find.c
@@ -243,10 +243,13 @@ cmd_find_current_session_with_client(struct cmd_find_state *fs)
struct window_pane *wp;
/* If this is running in a pane, that's great. */
- RB_FOREACH(wp, window_pane_tree, &all_window_panes) {
- if (strcmp(wp->tty, fs->cmdq->client->tty.path) == 0)
- break;
- }
+ if (fs->cmdq->client->tty.path != NULL) {
+ RB_FOREACH(wp, window_pane_tree, &all_window_panes) {
+ if (strcmp(wp->tty, fs->cmdq->client->tty.path) == 0)
+ break;
+ }
+ } else
+ wp = NULL;
/* Not running in a pane. We know nothing. Find the best session. */
if (wp == NULL) {