summaryrefslogtreecommitdiffstats
path: root/cmd-respawn-window.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-03-04 17:24:07 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-03-04 17:24:07 +0000
commit65b9aeb33707e9663ac594b872ab33b9a78d7daa (patch)
tree8e5683f752dd693c0d402adc21e4a47702e3ea4d /cmd-respawn-window.c
parent171256057ee19fd92262eeb50a2d01e21355a597 (diff)
Put socket path in $TMUX.
Diffstat (limited to 'cmd-respawn-window.c')
-rw-r--r--cmd-respawn-window.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/cmd-respawn-window.c b/cmd-respawn-window.c
index 8dcbfaea..bf3bfa6c 100644
--- a/cmd-respawn-window.c
+++ b/cmd-respawn-window.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-respawn-window.c,v 1.13 2009-01-23 16:59:14 nicm Exp $ */
+/* $Id: cmd-respawn-window.c,v 1.14 2009-03-04 17:24:07 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -49,9 +49,8 @@ cmd_respawn_window_exec(struct cmd *self, struct cmd_ctx *ctx)
struct window *w;
struct window_pane *wp;
struct session *s;
- const char *env[] = CHILD_ENVIRON;
- char buf[256], *cause;
- u_int i;
+ const char **env;
+ char *cause;
if ((wl = cmd_find_window(ctx, data->target, &s)) == NULL)
return (-1);
@@ -67,10 +66,7 @@ cmd_respawn_window_exec(struct cmd *self, struct cmd_ctx *ctx)
}
}
- if (session_index(s, &i) != 0)
- fatalx("session not found");
- xsnprintf(buf, sizeof buf, "TMUX=%ld,%u", (long) getpid(), i);
- env[0] = buf;
+ env = server_fill_environ(s);
wp = TAILQ_FIRST(&w->panes);
TAILQ_REMOVE(&w->panes, wp, entry);