summaryrefslogtreecommitdiffstats
path: root/cmd-respawn-window.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-01-23 16:59:14 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-01-23 16:59:14 +0000
commit4d9af27b0bbb19466aecc9a39b9eb94796b2c7d8 (patch)
tree894030570ec55749b620e654ef17ec311e80f7f9 /cmd-respawn-window.c
parent3f171917f6bce0fd5eb808a11b80d550d2a7d249 (diff)
Better error messages for fork.
Diffstat (limited to 'cmd-respawn-window.c')
-rw-r--r--cmd-respawn-window.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/cmd-respawn-window.c b/cmd-respawn-window.c
index deccb6f8..8dcbfaea 100644
--- a/cmd-respawn-window.c
+++ b/cmd-respawn-window.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-respawn-window.c,v 1.12 2009-01-19 18:23:40 nicm Exp $ */
+/* $Id: cmd-respawn-window.c,v 1.13 2009-01-23 16:59:14 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -50,7 +50,7 @@ cmd_respawn_window_exec(struct cmd *self, struct cmd_ctx *ctx)
struct window_pane *wp;
struct session *s;
const char *env[] = CHILD_ENVIRON;
- char buf[256];
+ char buf[256], *cause;
u_int i;
if ((wl = cmd_find_window(ctx, data->target, &s)) == NULL)
@@ -77,8 +77,9 @@ cmd_respawn_window_exec(struct cmd *self, struct cmd_ctx *ctx)
window_destroy_panes(w);
TAILQ_INSERT_HEAD(&w->panes, wp, entry);
window_pane_resize(wp, w->sx, w->sy);
- if (window_pane_spawn(wp, data->arg, NULL, env) != 0) {
- ctx->error(ctx, "respawn failed: %s:%d", s->name, wl->idx);
+ if (window_pane_spawn(wp, data->arg, NULL, env, &cause) != 0) {
+ ctx->error(ctx, "respawn window failed: %s", cause);
+ xfree(cause);
return (-1);
}
screen_reinit(&wp->base);