mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-29 19:43:41 +01:00
Update environment when switching sessions as well as attaching, from Si
Beaumont.
This commit is contained in:
parent
8e9b6e0948
commit
d174b9cfcc
@ -46,7 +46,7 @@ cmd_switch_client_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
struct winlink *wl = NULL;
|
struct winlink *wl = NULL;
|
||||||
struct window *w = NULL;
|
struct window *w = NULL;
|
||||||
struct window_pane *wp = NULL;
|
struct window_pane *wp = NULL;
|
||||||
const char *tflag, *tablename;
|
const char *tflag, *tablename, *update;
|
||||||
struct key_table *table;
|
struct key_table *table;
|
||||||
|
|
||||||
if ((c = cmd_find_client(cmdq, args_get(args, 'c'), 0)) == NULL)
|
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)
|
if (c->session != NULL)
|
||||||
c->last_session = c->session;
|
c->last_session = c->session;
|
||||||
c->session = s;
|
c->session = s;
|
||||||
|
Loading…
Reference in New Issue
Block a user