> Can't you just use cmd_find_pane? If the user doesn't specify a pane > it'll default to the active pane anyway so selecting it'll be a no-op.
Do you mean use a patch like this: diff --git a/cmd-attach-session.c b/cmd-attach-session.c index e4c0b23..7f7153e 100644 --- a/cmd-attach-session.c +++ b/cmd-attach-session.c @@ -47,6 +47,8 @@ cmd_attach_session(struct cmd_q *cmdq, const char *tflag, int dflag, int rflag, { struct session *s; struct client *c; + struct winlink *wl; + struct window_pane *wp; const char *update; char *cause; u_int i; @@ -59,12 +61,15 @@ cmd_attach_session(struct cmd_q *cmdq, const char *tflag, int dflag, int rflag, return (CMD_RETURN_ERROR); } - if ((s = cmd_find_session(cmdq, tflag, 1)) == NULL) + if ((wl = cmd_find_pane(cmdq, tflag, &s, &wp)) == NULL) return (CMD_RETURN_ERROR); if (cmdq->client == NULL) return (CMD_RETURN_NORMAL); + window_set_active_pane(wp->window, wp); + session_set_current(s, wl); + if (cmdq->client->session != NULL) { if (dflag) { /* If so, it won't work. Something like "-t 1" gets interpreted as window 1 in the last used session, and not session 1. Also, something like "-t @2" will only work if window 2 was in the last session you had attached to. ------------------------------------------------------------------------------ Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk _______________________________________________ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users