summaryrefslogtreecommitdiffstats
path: root/session.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2017-03-09 18:01:16 +0000
committerThomas Adam <thomas@xteddy.org>2017-03-09 18:01:16 +0000
commitc5bdae466e4dad6c185fa5146b11275b6119ff24 (patch)
tree05536631ebb8c314a3026748c2b20753594cc5af /session.c
parentfd96ccfd802aec27a4835f7bb2030003b9668e64 (diff)
parentbce1dee0341b3624d927d393fd0f21771660d5ed (diff)
Merge branch 'obsd-master'
Diffstat (limited to 'session.c')
-rw-r--r--session.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/session.c b/session.c
index 21c26e42..b69adeaa 100644
--- a/session.c
+++ b/session.c
@@ -354,16 +354,12 @@ session_new(struct session *s, const char *name, int argc, char **argv,
}
wl->session = s;
- env = environ_create();
- environ_copy(global_environ, env);
- environ_copy(s->environ, env);
- server_fill_environ(s, env);
-
shell = options_get_string(s->options, "default-shell");
if (*shell == '\0' || areshell(shell))
shell = _PATH_BSHELL;
hlimit = options_get_number(s->options, "history-limit");
+ env = environ_for_session(s);
w = window_create_spawn(name, argc, argv, path, shell, cwd, env, s->tio,
s->sx, s->sy, hlimit, cause);
if (w == NULL) {
@@ -372,8 +368,8 @@ session_new(struct session *s, const char *name, int argc, char **argv,
return (NULL);
}
winlink_set_window(wl, w);
- notify_session_window("window-linked", s, w);
environ_free(env);
+ notify_session_window("window-linked", s, w);
session_group_synchronize_from(s);
return (wl);