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

windows.

This is "screen" by default and must be either that or something closely
related. This does makes it easier to customise it if necessary.
This commit is contained in:
Nicholas Marriott
2009-07-10 05:50:54 +00:00
parent 25d5734496
commit daa1faa905
5 changed files with 21 additions and 3 deletions

View File

@ -29,8 +29,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)
@ -40,6 +40,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);
}