diff options
| author | 2015-05-07 14:07:16 +0000 | |
|---|---|---|
| committer | 2015-05-07 14:07:16 +0000 | |
| commit | a535bf24a99bb5bf4926c9e75839969ad4118aa0 (patch) | |
| tree | d9f549402e8a0b93ea7cf738d31f24c7d273b7f5 /usr.bin/tmux/cmd-switch-client.c | |
| parent | Do not let the -m option or MANPATH with leading, trailing, or double (diff) | |
| download | wireguard-openbsd-a535bf24a99bb5bf4926c9e75839969ad4118aa0.tar.xz wireguard-openbsd-a535bf24a99bb5bf4926c9e75839969ad4118aa0.zip | |
Update environment when switching sessions as well as attaching, from Si
Beaumont.
Diffstat (limited to 'usr.bin/tmux/cmd-switch-client.c')
| -rw-r--r-- | usr.bin/tmux/cmd-switch-client.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd-switch-client.c b/usr.bin/tmux/cmd-switch-client.c index ddf3e7f54d8..6ada6b3fce9 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.24 2015/04/25 18:09:28 nicm Exp $ */ +/* $OpenBSD: cmd-switch-client.c,v 1.25 2015/05/07 14:07:16 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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; |
