/* $OpenBSD$ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicm@users.sourceforge.net>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <sys/types.h>
#include <string.h>
#include <paths.h>
#include "tmux.h"
/*
* This file has a tables with all the server, session and window
* options. These tables are the master copy of the options with their real
* (user-visible) types, range limits and default values. At start these are
* copied into the runtime global options trees (which only has number and
* string types). These tables are then used to look up the real type when the
* user sets an option or its value needs to be shown.
*/
/* Choice option type lists. */
const char *options_table_mode_keys_list[] = {
"emacs", "vi", NULL
};
const char *options_table_clock_mode_style_list[] = {
"12", "24", NULL
};
const char *options_table_status_keys_list[] = {
"emacs", "vi", NULL
};
const char *options_table_status_justify_list[] = {
"left", "centre", "right", NULL
};
const char *options_table_status_position_list[] = {
"top", "bottom", NULL
};
const char *options_table_bell_action_list[] = {
"none", "any", "current", NULL
};
/* Server options. */
const struct options_table_entry server_options_table[] = {
{ .name = "buffer-limit",
.type = OPTIONS_TABLE_NUMBER,
.minimum = 1,
.maximum = INT_MAX,
.default_num = 20
},
{ .name = "escape-time",
.type = OPTIONS_TABLE_NUMBER,
.minimum = 0,
.maximum = INT_MAX,
.default_num = 500
},
{ .name = "exit-unattached",
.type = OPTIONS_TABLE_FLAG,
.default_num = 0
},
{ .name = "focus-events",
.type = OPTIONS_TABLE_FLAG,
.default_num = 0
},
{ .name = "message-limit",
.type = OPTIONS_TABLE_NUMBER,
.minimum = 0,
.maximum = INT_MAX,
.default_num = 100
},
{ .name = "quiet",
.type = OPTIONS_TABLE_FLAG,
.default_num = 0
},
{ .name = "set-clipboard",
.type = OPTIONS_TABLE_FLAG,
.default_num = 1
},
{ .name = "terminal-overrides",
.type = OPTIONS_TABLE_STRING,
.default_str = "*256col*:colors=256"
",xterm*:XT:Ms=\\E]52;%p1%s;%p2%s\\007"
":Cs=\\E]12;%p1%s\\007:Cr=\\E]112\\007"
":Ss=\\E[%p1%d q:Se=\\E[2 q,screen*:XT"
},
{ .name = NULL }
};
/* Session options. */
const struct options_table_entry session_options_table[] = {
{ .name = "assume-paste-time",
.type = OPTIONS_TABLE_NUMBER,
.minimum = 0,
.maximum = INT_MAX,
.default_num = 1,
},
{ .name = "base-index",
.type = OPTIONS_TABLE_NUMBER,
.minimum = 0,
.maximum = INT_MAX,
.default_num = 0
},
{ .name = "bell-action",
.type = OPTIONS_TABLE_CHOICE,
.choices = options_table_bell_action_list,
.default_num = BELL_ANY
},
{ .name = "bell-on-alert",
.type = OPTIONS_TABLE_FLAG,
.default_num = 0
},
{ .name = "default-command",
.type = OPTIONS_TABLE_STRING,
.default_str = ""
},
{ .name = "default-shell",
.type = OPTIONS_TABLE_STRING,
.default_str = _PATH_BSHELL
},
{ .name = "default-terminal",
.type = OPTIONS_TABLE_STRING,
.default_str = "screen"
},
{ .name = "destroy-unattached",
.type = OPTIONS_TABLE_FLAG,
.default_num = 0
},
{ .name = "detach-on-destroy",
.type = OPTIONS_TABLE_FLAG,
.default_num = 1
},
{ .name = "display-panes-active-colour",
.type = OPTIONS_TABLE_COLOUR,
.default_num = 1
},
{ .name = "display-panes-colour",
.type = OPTIONS_TABLE_COLOUR,
.default_num = 4
},
{ .name = "display-panes-time",
.type = OPTIONS_TABLE_NUMBER,
.minimum = 1,
.maximum = INT_MAX,
.default_num = 1000
},
{ .name = "display-time",
.type = OPTIONS_TABLE_NUMBER,
.minimum = 1,
.maximum = INT_MAX,
.default_num = 750
},
{ .name = "history-limit",
.type = OPTIONS_TABLE_NUMBER,