aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd-attach-session.c6
-rw-r--r--cmd-switch-client.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/cmd-attach-session.c b/cmd-attach-session.c
index cb58d4e2..e7cde0f0 100644
--- a/cmd-attach-session.c
+++ b/cmd-attach-session.c
@@ -126,6 +126,12 @@ cmd_attach_session(struct cmd_q *cmdq, const char *tflag, int dflag, int rflag,
s->cwd = fd;
}
+ if (!Eflag) {
+ update = options_get_string(&s->options,
+ "update-environment");
+ environ_update(update, &c->environ, &s->environ);
+ }
+
c->session = s;
notify_attached_session_changed(c);
session_update_activity(s);
diff --git a/cmd-switch-client.c b/cmd-switch-client.c
index 23751d73..4bac540d 100644
--- a/cmd-switch-client.c
+++ b/cmd-switch-client.c
@@ -119,7 +119,7 @@ cmd_switch_client_exec(struct cmd *self, struct cmd_q *cmdq)
}
}
- if (c != NULL && s != c->session && !args_has(args, 'E')) {
+ if (c != NULL && !args_has(args, 'E')) {
update = options_get_string(&s->options, "update-environment");
environ_update(update, &c->environ, &s->environ);
}