version 1.28, 2015/04/27 16:25:57 |
version 1.29, 2015/12/13 14:32:38 |
|
|
"S:W:swub:c:t:", 0, 1, |
"S:W:swub:c:t:", 0, 1, |
"[-suw] [-b session-template] [-c window template] [-S format] " \ |
"[-suw] [-b session-template] [-c window template] [-S format] " \ |
"[-W format] " CMD_TARGET_WINDOW_USAGE, |
"[-W format] " CMD_TARGET_WINDOW_USAGE, |
0, |
CMD_WINDOW_T, |
cmd_choose_tree_exec |
cmd_choose_tree_exec |
}; |
}; |
|
|
|
|
"choose-session", NULL, |
"choose-session", NULL, |
"F:t:", 0, 1, |
"F:t:", 0, 1, |
CMD_TARGET_WINDOW_USAGE " [-F format] [template]", |
CMD_TARGET_WINDOW_USAGE " [-F format] [template]", |
0, |
CMD_WINDOW_T, |
cmd_choose_tree_exec |
cmd_choose_tree_exec |
}; |
}; |
|
|
|
|
"choose-window", NULL, |
"choose-window", NULL, |
"F:t:", 0, 1, |
"F:t:", 0, 1, |
CMD_TARGET_WINDOW_USAGE "[-F format] [template]", |
CMD_TARGET_WINDOW_USAGE "[-F format] [template]", |
0, |
CMD_WINDOW_T, |
cmd_choose_tree_exec |
cmd_choose_tree_exec |
}; |
}; |
|
|
|
|
cmd_choose_tree_exec(struct cmd *self, struct cmd_q *cmdq) |
cmd_choose_tree_exec(struct cmd *self, struct cmd_q *cmdq) |
{ |
{ |
struct args *args = self->args; |
struct args *args = self->args; |
struct winlink *wl, *wm; |
struct client *c = cmdq->state.c; |
struct session *s, *s2; |
struct winlink *wl = cmdq->state.tflag.wl, *wm; |
struct client *c; |
struct session *s = cmdq->state.tflag.s, *s2; |
struct window_choose_data *wcd = NULL; |
struct window_choose_data *wcd = NULL; |
const char *ses_template, *win_template; |
const char *ses_template, *win_template; |
char *final_win_action, *cur_win_template; |
char *final_win_action, *cur_win_template; |
|
|
ses_template = win_template = NULL; |
ses_template = win_template = NULL; |
ses_action = win_action = NULL; |
ses_action = win_action = NULL; |
|
|
if ((c = cmd_find_client(cmdq, NULL, 1)) == NULL) { |
if (c == NULL) { |
cmdq_error(cmdq, "no client available"); |
cmdq_error(cmdq, "no client available"); |
return (CMD_RETURN_ERROR); |
return (CMD_RETURN_ERROR); |
} |
} |
|
|
if ((wl = cmd_find_window(cmdq, args_get(args, 't'), &s)) == NULL) |
|
return (CMD_RETURN_ERROR); |
|
|
|
if (window_pane_set_mode(wl->window->active, &window_choose_mode) != 0) |
if (window_pane_set_mode(wl->window->active, &window_choose_mode) != 0) |
return (CMD_RETURN_NORMAL); |
return (CMD_RETURN_NORMAL); |