diff options
author | Tiago Cunha <tcunha@gmx.com> | 2009-08-09 17:48:55 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2009-08-09 17:48:55 +0000 |
commit | 29b1b2fb5eee4319cdc1464ee377b68f3171dc27 (patch) | |
tree | 724627190ad66e119ec2771c5731e720a70ea3e9 /server-msg.c | |
parent | af3db9a4fea9c436ff8e6f452a538ba295e1e6fe (diff) | |
download | rtmux-29b1b2fb5eee4319cdc1464ee377b68f3171dc27.tar.gz rtmux-29b1b2fb5eee4319cdc1464ee377b68f3171dc27.tar.bz2 rtmux-29b1b2fb5eee4319cdc1464ee377b68f3171dc27.zip |
Sync OpenBSD patchset 231:
Infrastructure and commands to manage the environment for processes started
within tmux.
There is a global environment, copied from the external environment when the
server is started and each session has an (initially empty) session
environment which overrides it.
New commands set-environment and show-environment manipulate or display the
environments.
A new session option, update-environment, is a space-separated list of
variables which are updated from the external environment into the session
environment every time a new session is created - the default is DISPLAY.
Diffstat (limited to 'server-msg.c')
-rw-r--r-- | server-msg.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/server-msg.c b/server-msg.c index 97a4b5cd..c6721c09 100644 --- a/server-msg.c +++ b/server-msg.c @@ -1,4 +1,4 @@ -/* $Id: server-msg.c,v 1.76 2009-07-30 21:01:01 tcunha Exp $ */ +/* $Id: server-msg.c,v 1.77 2009-08-09 17:48:55 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -42,6 +42,7 @@ server_msg_dispatch(struct client *c) struct msg_identify_data identifydata; struct msg_resize_data resizedata; struct msg_unlock_data unlockdata; + struct msg_environ_data environdata; for (;;) { if (BUFFER_USED(c->in) < sizeof hdr) @@ -100,6 +101,15 @@ server_msg_dispatch(struct client *c) tty_start_tty(&c->tty); server_redraw_client(c); break; + case MSG_ENVIRON: + if (hdr.size != sizeof environdata) + fatalx("bad MSG_ENVIRON size"); + buffer_read(c->in, &environdata, sizeof environdata); + + environdata.var[(sizeof environdata.var) - 1] = '\0'; + if (strchr(environdata.var, '=') != NULL) + environ_put(&c->environ, environdata.var); + break; default: fatalx("unexpected message"); } |