=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-choose-tree.c,v retrieving revision 1.15 retrieving revision 1.16 diff -c -r1.15 -r1.16 *** src/usr.bin/tmux/cmd-choose-tree.c 2013/03/21 16:09:17 1.15 --- src/usr.bin/tmux/cmd-choose-tree.c 2013/03/21 16:09:59 1.16 *************** *** 1,4 **** ! /* $OpenBSD: cmd-choose-tree.c,v 1.15 2013/03/21 16:09:17 nicm Exp $ */ /* * Copyright (c) 2012 Thomas Adam --- 1,4 ---- ! /* $OpenBSD: cmd-choose-tree.c,v 1.16 2013/03/21 16:09:59 nicm Exp $ */ /* * Copyright (c) 2012 Thomas Adam *************** *** 71,76 **** --- 71,77 ---- struct args *args = self->args; struct winlink *wl, *wm; struct session *s, *s2; + struct client *c; struct window_choose_data *wcd = NULL; const char *ses_template, *win_template; char *final_win_action, *cur_win_template; *************** *** 83,94 **** ses_template = win_template = NULL; ses_action = win_action = NULL; ! if (ctx->curclient == NULL) { ! ctx->error(ctx, "must be run interactively"); return (CMD_RETURN_ERROR); } ! s = ctx->curclient->session; if ((wl = cmd_find_window(ctx, args_get(args, 't'), NULL)) == NULL) return (CMD_RETURN_ERROR); --- 84,96 ---- ses_template = win_template = NULL; ses_action = win_action = NULL; ! if ((c = cmd_current_client(ctx)) == NULL) { ! ctx->error(ctx, "no client available"); return (CMD_RETURN_ERROR); } ! if ((s = c->session) == NULL) ! return (CMD_RETURN_ERROR); if ((wl = cmd_find_window(ctx, args_get(args, 't'), NULL)) == NULL) return (CMD_RETURN_ERROR); *************** *** 172,178 **** } wcd = window_choose_add_session(wl->window->active, ! ctx, s2, ses_template, (char *)ses_action, idx_ses); /* If we're just choosing sessions, skip choosing windows. */ if (sflag && !wflag) { --- 174,180 ---- } wcd = window_choose_add_session(wl->window->active, ! c, s2, ses_template, (char *)ses_action, idx_ses); /* If we're just choosing sessions, skip choosing windows. */ if (sflag && !wflag) { *************** *** 210,216 **** cur_win_template = final_win_template_last; window_choose_add_window(wl->window->active, ! ctx, s2, wm, cur_win_template, final_win_action, (wflag && !sflag) ? win_ses : idx_ses); --- 212,218 ---- cur_win_template = final_win_template_last; window_choose_add_window(wl->window->active, ! c, s2, wm, cur_win_template, final_win_action, (wflag && !sflag) ? win_ses : idx_ses);