version 1.45, 2020/04/13 08:26:27 |
version 1.46, 2020/04/13 10:59:58 |
|
|
static enum cmd_retval |
static enum cmd_retval |
cmd_list_windows_exec(struct cmd *self, struct cmdq_item *item) |
cmd_list_windows_exec(struct cmd *self, struct cmdq_item *item) |
{ |
{ |
struct args *args = cmd_get_args(self); |
struct args *args = cmd_get_args(self); |
|
struct cmd_find_state *target = cmdq_get_target(item); |
|
|
if (args_has(args, 'a')) |
if (args_has(args, 'a')) |
cmd_list_windows_server(self, item); |
cmd_list_windows_server(self, item); |
else |
else |
cmd_list_windows_session(self, item->target.s, item, 0); |
cmd_list_windows_session(self, target->s, item, 0); |
|
|
return (CMD_RETURN_NORMAL); |
return (CMD_RETURN_NORMAL); |
} |
} |
|
|
|
|
n = 0; |
n = 0; |
RB_FOREACH(wl, winlinks, &s->windows) { |
RB_FOREACH(wl, winlinks, &s->windows) { |
ft = format_create(item->client, item, FORMAT_NONE, 0); |
ft = format_create(cmdq_get_client(item), item, FORMAT_NONE, 0); |
format_add(ft, "line", "%u", n); |
format_add(ft, "line", "%u", n); |
format_defaults(ft, NULL, s, wl, NULL); |
format_defaults(ft, NULL, s, wl, NULL); |
|
|