version 1.11, 2012/05/29 08:12:13 |
version 1.12, 2012/07/11 07:10:15 |
|
|
* Destroy window. |
* Destroy window. |
*/ |
*/ |
|
|
int cmd_kill_window_exec(struct cmd *, struct cmd_ctx *); |
enum cmd_retval cmd_kill_window_exec(struct cmd *, struct cmd_ctx *); |
|
|
const struct cmd_entry cmd_kill_window_entry = { |
const struct cmd_entry cmd_kill_window_entry = { |
"kill-window", "killw", |
"kill-window", "killw", |
|
|
cmd_kill_window_exec |
cmd_kill_window_exec |
}; |
}; |
|
|
int |
enum cmd_retval |
cmd_kill_window_exec(struct cmd *self, struct cmd_ctx *ctx) |
cmd_kill_window_exec(struct cmd *self, struct cmd_ctx *ctx) |
{ |
{ |
struct args *args = self->args; |
struct args *args = self->args; |
|
|
struct session *s; |
struct session *s; |
|
|
if ((wl = cmd_find_window(ctx, args_get(args, 't'), &s)) == NULL) |
if ((wl = cmd_find_window(ctx, args_get(args, 't'), &s)) == NULL) |
return (-1); |
return (CMD_RETURN_ERROR); |
|
|
if (args_has(args, 'a')) { |
if (args_has(args, 'a')) { |
RB_FOREACH_SAFE(wl2, winlinks, &s->windows, wl3) { |
RB_FOREACH_SAFE(wl2, winlinks, &s->windows, wl3) { |
|
|
server_kill_window(wl->window); |
server_kill_window(wl->window); |
|
|
recalculate_sizes(); |
recalculate_sizes(); |
return (0); |
return (CMD_RETURN_NORMAL); |
} |
} |