summaryrefslogtreecommitdiffstats
path: root/cmd-switch-client.c
diff options
context:
space:
mode:
authornicm <nicm>2015-05-07 14:07:16 +0000
committernicm <nicm>2015-05-07 14:07:16 +0000
commitd174b9cfcc2d4c60bd89804ef63e5ee41ca6d490 (patch)
tree18f822117f66ef9f271f68efc135828bf5611841 /cmd-switch-client.c
parent8e9b6e09485f3400aac9e6cd8a711e2cc1819b03 (diff)
Update environment when switching sessions as well as attaching, from Si
Beaumont.
Diffstat (limited to 'cmd-switch-client.c')
-rw-r--r--cmd-switch-client.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd-switch-client.c b/cmd-switch-client.c
index 18de0eb1..369fc917 100644
--- a/cmd-switch-client.c
+++ b/cmd-switch-client.c
@@ -46,7 +46,7 @@ cmd_switch_client_exec(struct cmd *self, struct cmd_q *cmdq)
struct winlink *wl = NULL;
struct window *w = NULL;
struct window_pane *wp = NULL;
- const char *tflag, *tablename;
+ const char *tflag, *tablename, *update;
struct key_table *table;
if ((c = cmd_find_client(cmdq, args_get(args, 'c'), 0)) == NULL)
@@ -119,6 +119,11 @@ cmd_switch_client_exec(struct cmd *self, struct cmd_q *cmdq)
}
}
+ if (c != NULL && s != c->session) {
+ update = options_get_string(&s->options, "update-environment");
+ environ_update(update, &c->environ, &s->environ);
+ }
+
if (c->session != NULL)
c->last_session = c->session;
c->session = s;