summaryrefslogtreecommitdiffstats
path: root/server-fn.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-07-10 05:50:54 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-07-10 05:50:54 +0000
commitdaa1faa90510c09ddface800101ea86b167d1154 (patch)
tree77731d240614832e1d58ee1b31c491b60f9b9aa9 /server-fn.c
parent25d57344966902e9d5a93eb46727a2f1ebd46a82 (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 'server-fn.c')
-rw-r--r--server-fn.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/server-fn.c b/server-fn.c
index fb40a624..2d6709f5 100644
--- a/server-fn.c
+++ b/server-fn.c
@@ -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);
}