summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/server-fn.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-07-10 05:50:55 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-07-10 05:50:55 +0000
commit68a0f9c7c08774fdd34a259e91c1d9898cc73262 (patch)
tree4fe4baed01bdd3055c9bb6b24d5ad56cb57b6058 /usr.bin/tmux/server-fn.c
parent027f5fa01a6342a349399eafe782c76d0edcd7dc (diff)
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.
Diffstat (limited to 'usr.bin/tmux/server-fn.c')
-rw-r--r--usr.bin/tmux/server-fn.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/tmux/server-fn.c b/usr.bin/tmux/server-fn.c
index e6003d98607..2226b7ccf97 100644
--- a/usr.bin/tmux/server-fn.c
+++ b/usr.bin/tmux/server-fn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server-fn.c,v 1.3 2009/06/30 13:40:30 nicm Exp $ */
+/* $OpenBSD: server-fn.c,v 1.4 2009/07/10 05:50:54 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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);
}