summaryrefslogtreecommitdiffstats
path: root/cmd-respawn-window.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2008-06-30 18:45:02 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2008-06-30 18:45:02 +0000
commit8969a8beafcf7ba81c55eb1a8e036066ba1bace5 (patch)
tree0f3d1774242a7219ebfaa02d32b314f62de7c53a /cmd-respawn-window.c
parent80a594cae33ac195e37fcff9c383bf335388ef6a (diff)
Don't copy default command, use NULL if specified to use previous command.
Diffstat (limited to 'cmd-respawn-window.c')
-rw-r--r--cmd-respawn-window.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/cmd-respawn-window.c b/cmd-respawn-window.c
index 0b3cb0de..429beba5 100644
--- a/cmd-respawn-window.c
+++ b/cmd-respawn-window.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-respawn-window.c,v 1.1 2008-06-29 07:04:30 nicm Exp $ */
+/* $Id: cmd-respawn-window.c,v 1.2 2008-06-30 18:45:02 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -46,7 +46,6 @@ cmd_respawn_window_exec(struct cmd *self, struct cmd_ctx *ctx)
struct winlink *wl;
struct session *s;
const char *env[] = { NULL, "TERM=screen", NULL };
- char *cmd;
if ((wl = cmd_find_window(ctx, data->target, &s)) == NULL)
return;
@@ -56,11 +55,7 @@ cmd_respawn_window_exec(struct cmd *self, struct cmd_ctx *ctx)
return;
}
- cmd = data->arg;
- if (cmd == NULL)
- cmd = options_get_string(&s->options, "default-command");
-
- if (window_spawn(wl->window, cmd, env) != 0) {
+ if (window_spawn(wl->window, data->arg, env) != 0) {
ctx->error(ctx, "respawn failed: %s:%d", s->name, wl->idx);
return;
}