summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-attach-session.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/tmux/cmd-attach-session.c')
-rw-r--r--usr.bin/tmux/cmd-attach-session.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/tmux/cmd-attach-session.c b/usr.bin/tmux/cmd-attach-session.c
index 4d6438efac9..7117021f310 100644
--- a/usr.bin/tmux/cmd-attach-session.c
+++ b/usr.bin/tmux/cmd-attach-session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-attach-session.c,v 1.33 2015/04/24 23:17:11 nicm Exp $ */
+/* $OpenBSD: cmd-attach-session.c,v 1.34 2015/04/25 18:09:28 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -69,9 +69,12 @@ cmd_attach_session(struct cmd_q *cmdq, const char *tflag, int dflag, int rflag,
} else {
if ((s = cmd_find_session(cmdq, tflag, 1)) == NULL)
return (CMD_RETURN_ERROR);
- w = cmd_lookup_windowid(tflag);
- if (w == NULL && (wp = cmd_lookup_paneid(tflag)) != NULL)
- w = wp->window;
+ w = window_find_by_id_str(tflag);
+ if (w == NULL) {
+ wp = window_pane_find_by_id_str(tflag);
+ if (wp != NULL)
+ w = wp->window;
+ }
if (w != NULL)
wl = winlink_find_by_window(&s->windows, w);
}