version 1.25, 2015/10/31 08:13:58 |
version 1.26, 2015/12/13 14:32:38 |
|
|
"respawn-window", "respawnw", |
"respawn-window", "respawnw", |
"kt:", 0, -1, |
"kt:", 0, -1, |
"[-k] " CMD_TARGET_WINDOW_USAGE " [command]", |
"[-k] " CMD_TARGET_WINDOW_USAGE " [command]", |
0, |
CMD_WINDOW_T, |
cmd_respawn_window_exec |
cmd_respawn_window_exec |
}; |
}; |
|
|
|
|
cmd_respawn_window_exec(struct cmd *self, struct cmd_q *cmdq) |
cmd_respawn_window_exec(struct cmd *self, struct cmd_q *cmdq) |
{ |
{ |
struct args *args = self->args; |
struct args *args = self->args; |
struct winlink *wl; |
struct session *s = cmdq->state.tflag.s; |
struct window *w; |
struct winlink *wl = cmdq->state.tflag.wl; |
|
struct window *w = wl->window; |
struct window_pane *wp; |
struct window_pane *wp; |
struct session *s; |
|
struct environ *env; |
struct environ *env; |
const char *path; |
const char *path; |
char *cause; |
char *cause; |
struct environ_entry *envent; |
struct environ_entry *envent; |
|
|
if ((wl = cmd_find_window(cmdq, args_get(args, 't'), &s)) == NULL) |
|
return (CMD_RETURN_ERROR); |
|
w = wl->window; |
|
|
|
if (!args_has(self->args, 'k')) { |
if (!args_has(self->args, 'k')) { |
TAILQ_FOREACH(wp, &w->panes, entry) { |
TAILQ_FOREACH(wp, &w->panes, entry) { |
if (wp->fd == -1) |
if (wp->fd == -1) |
continue; |
continue; |
cmdq_error(cmdq, |
cmdq_error(cmdq, "window still active: %s:%d", s->name, |
"window still active: %s:%d", s->name, wl->idx); |
wl->idx); |
return (CMD_RETURN_ERROR); |
return (CMD_RETURN_ERROR); |
} |
} |
} |
} |