Add a default-terminal option to set the starting value of $TERM in new

windows.
This commit is contained in:
Nicholas Marriott
2009-07-12 17:07:58 +00:00
parent 79bc6041c9
commit d7b4aa0ff3
5 changed files with 26 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $Id: server-fn.c,v 1.69 2009-07-08 18:07:09 nicm Exp $ */
/* $Id: server-fn.c,v 1.70 2009-07-12 17:07:58 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -30,8 +30,8 @@ int server_lock_callback(void *, const char *);
const char **
server_fill_environ(struct session *s)
{
static const char *env[] = { NULL /* TMUX= */, "TERM=screen", NULL };
static char tmuxvar[MAXPATHLEN + 256];
static const char *env[] = { NULL /* TMUX= */, NULL /* TERM */, NULL };
static char tmuxvar[MAXPATHLEN + 256], termvar[256];
u_int idx;
if (session_index(s, &idx) != 0)
@ -41,6 +41,10 @@ server_fill_environ(struct session *s)
"TMUX=%s,%ld,%u", socket_path, (long) getpid(), idx);
env[0] = tmuxvar;
xsnprintf(termvar, sizeof termvar,
"TERM=%s", options_get_string(&s->options, "default-terminal"));
env[1] = termvar;
return (env);
}