Move server_fill_environ into environ.c and move some other common code

into it.
This commit is contained in:
nicm
2017-03-09 17:02:38 +00:00
parent e8f2609ca4
commit dbfee6a468
8 changed files with 40 additions and 52 deletions

View File

@ -32,24 +32,6 @@ static struct session *server_next_session(struct session *);
static void server_callback_identify(int, short, void *);
static void server_destroy_session_group(struct session *);
void
server_fill_environ(struct session *s, struct environ *env)
{
const char *term;
u_int idx;
long pid;
if (s != NULL) {
term = options_get_string(global_options, "default-terminal");
environ_set(env, "TERM", "%s", term);
idx = s->id;
} else
idx = (u_int)-1;
pid = getpid();
environ_set(env, "TMUX", "%s,%ld,%u", socket_path, pid, idx);
}
void
server_redraw_client(struct client *c)
{