version 1.5, 2009/07/26 12:58:44 |
version 1.6, 2009/08/08 21:52:43 |
|
|
struct window *w; |
struct window *w; |
struct window_pane *wp; |
struct window_pane *wp; |
struct session *s; |
struct session *s; |
const char **env; |
struct environ env; |
char *cause; |
char *cause; |
|
|
if ((wl = cmd_find_window(ctx, data->target, &s)) == NULL) |
if ((wl = cmd_find_window(ctx, data->target, &s)) == NULL) |
|
|
} |
} |
} |
} |
|
|
env = server_fill_environ(s); |
environ_init(&env); |
|
environ_copy(&global_environ, &env); |
|
environ_copy(&s->environ, &env); |
|
server_fill_environ(s, &env); |
|
|
wp = TAILQ_FIRST(&w->panes); |
wp = TAILQ_FIRST(&w->panes); |
TAILQ_REMOVE(&w->panes, wp, entry); |
TAILQ_REMOVE(&w->panes, wp, entry); |
|
|
window_destroy_panes(w); |
window_destroy_panes(w); |
TAILQ_INSERT_HEAD(&w->panes, wp, entry); |
TAILQ_INSERT_HEAD(&w->panes, wp, entry); |
window_pane_resize(wp, w->sx, w->sy); |
window_pane_resize(wp, w->sx, w->sy); |
if (window_pane_spawn(wp, data->arg, NULL, env, &cause) != 0) { |
if (window_pane_spawn(wp, data->arg, NULL, &env, &cause) != 0) { |
ctx->error(ctx, "respawn window failed: %s", cause); |
ctx->error(ctx, "respawn window failed: %s", cause); |
xfree(cause); |
xfree(cause); |
|
environ_free(&env); |
return (-1); |
return (-1); |
} |
} |
layout_init(w); |
layout_init(w); |
|
|
recalculate_sizes(); |
recalculate_sizes(); |
server_redraw_window(w); |
server_redraw_window(w); |
|
|
|
environ_free(&env); |
return (0); |
return (0); |
} |
} |