diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-07-12 17:07:58 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-07-12 17:07:58 +0000 |
commit | d7b4aa0ff36f8230103f29cc233fed341f0d5fa3 (patch) | |
tree | 827ecbe7eb876376b7efa1a53a563acb9520a009 | |
parent | 79bc6041c96f5e1dc8b1fb7d71c91bf73a138e96 (diff) | |
download | rtmux-d7b4aa0ff36f8230103f29cc233fed341f0d5fa3.tar.gz rtmux-d7b4aa0ff36f8230103f29cc233fed341f0d5fa3.tar.bz2 rtmux-d7b4aa0ff36f8230103f29cc233fed341f0d5fa3.zip |
Add a default-terminal option to set the starting value of $TERM in new
windows.
-rw-r--r-- | cmd-set-option.c | 3 | ||||
-rw-r--r-- | server-fn.c | 10 | ||||
-rw-r--r-- | tmux.1 | 14 | ||||
-rw-r--r-- | tmux.c | 3 | ||||
-rw-r--r-- | tmux.h | 4 |
5 files changed, 26 insertions, 8 deletions
diff --git a/cmd-set-option.c b/cmd-set-option.c index f68fd47c..8ef39ffe 100644 --- a/cmd-set-option.c +++ b/cmd-set-option.c @@ -1,4 +1,4 @@ -/* $Id: cmd-set-option.c,v 1.64 2009-07-08 18:03:03 nicm Exp $ */ +/* $Id: cmd-set-option.c,v 1.65 2009-07-12 17:07:58 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -53,6 +53,7 @@ const struct set_option_entry set_option_table[NSETOPTION] = { { "buffer-limit", SET_OPTION_NUMBER, 1, INT_MAX, NULL }, { "default-command", SET_OPTION_STRING, 0, 0, NULL }, { "default-path", SET_OPTION_STRING, 0, 0, NULL }, + { "default-terminal", SET_OPTION_STRING, 0, 0, NULL }, { "display-time", SET_OPTION_NUMBER, 1, INT_MAX, NULL }, { "history-limit", SET_OPTION_NUMBER, 0, INT_MAX, NULL }, { "lock-after-time", SET_OPTION_NUMBER, 0, INT_MAX, NULL }, diff --git a/server-fn.c b/server-fn.c index 9c920e28..db65c175 100644 --- a/server-fn.c +++ b/server-fn.c @@ -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); } @@ -1,4 +1,4 @@ -.\" $Id: tmux.1,v 1.108 2009-07-12 17:04:21 nicm Exp $ +.\" $Id: tmux.1,v 1.109 2009-07-12 17:07:58 nicm Exp $ .\" .\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> .\" @@ -1090,6 +1090,18 @@ environment variable or, if it is unset, the user's shell returned by Set the default working directory for processes created from keys, or interactively from the prompt. The default is the current working directory when the server is started. +.It Ic default-terminal Ar terminal +Set the default terminal for new windows created in this session - the +default value of the +.Ev TERM +environment variable. +For +.Nm +to work correctly, this +.Em must +be set to +.Ql screen +or a derivative of it. .It Ic display-time Ar time Set the amount of time for which status line messages are displayed. .Ar time @@ -1,4 +1,4 @@ -/* $Id: tmux.c,v 1.141 2009-07-08 18:12:57 nicm Exp $ */ +/* $Id: tmux.c,v 1.142 2009-07-12 17:07:58 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -279,6 +279,7 @@ main(int argc, char **argv) options_set_number(&global_s_options, "bell-action", BELL_ANY); options_set_number(&global_s_options, "buffer-limit", 9); options_set_string(&global_s_options, "default-command", "%s", ""); + options_set_string(&global_s_options, "default-terminal", "screen"); options_set_number(&global_s_options, "display-time", 750); options_set_number(&global_s_options, "history-limit", 2000); options_set_number(&global_s_options, "lock-after-time", 0); @@ -1,4 +1,4 @@ -/* $Id: tmux.h,v 1.353 2009-07-09 18:14:18 nicm Exp $ */ +/* $Id: tmux.h,v 1.354 2009-07-12 17:07:58 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -934,7 +934,7 @@ struct set_option_entry { }; extern const struct set_option_entry set_option_table[]; extern const struct set_option_entry set_window_option_table[]; -#define NSETOPTION 25 +#define NSETOPTION 26 #define NSETWINDOWOPTION 19 /* tmux.c */ |