From 65b9aeb33707e9663ac594b872ab33b9a78d7daa Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 4 Mar 2009 17:24:07 +0000 Subject: Put socket path in $TMUX. --- cmd-respawn-window.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'cmd-respawn-window.c') 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 @@ -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); -- cgit