summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2015-07-06 14:24:58 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2015-07-06 14:24:58 +0000
commitaf805245e2748244e812d66a3a9aa0280ef1c1a8 (patch)
tree35b04ea4a0b1429f443661e4258be1bc8a0506b4 /usr.bin
parent383c0ac030773d6dad132f550b610e67408e0dc3 (diff)
Update environment with -E when attach-session used on an already
attached session or switch-client used on the current session. From Cam Hutchison.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/cmd-attach-session.c8
-rw-r--r--usr.bin/tmux/cmd-switch-client.c4
2 files changed, 9 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd-attach-session.c b/usr.bin/tmux/cmd-attach-session.c
index 968cf6ac0b5..ca5306a4036 100644
--- a/usr.bin/tmux/cmd-attach-session.c
+++ b/usr.bin/tmux/cmd-attach-session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-attach-session.c,v 1.37 2015/06/09 07:07:06 nicm Exp $ */
+/* $OpenBSD: cmd-attach-session.c,v 1.38 2015/07/06 14:24:57 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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/usr.bin/tmux/cmd-switch-client.c b/usr.bin/tmux/cmd-switch-client.c
index 8d15fefd55b..367c3e38bc1 100644
--- a/usr.bin/tmux/cmd-switch-client.c
+++ b/usr.bin/tmux/cmd-switch-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-switch-client.c,v 1.26 2015/06/07 21:39:39 nicm Exp $ */
+/* $OpenBSD: cmd-switch-client.c,v 1.27 2015/07/06 14:24:57 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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);
}