/* $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", "other", NULL
};
/* Server options. */
const struct options_table_entry options_table[] = {
{ .name = "buffer-limit",
.type = OPTIONS_TABLE_NUMBER,
.scope = OPTIONS_TABLE_SERVER,
.minimum = 1,
.maximum = INT_MAX,
.default_num = 20
},
{ .name = "default-terminal",
.type = OPTIONS_TABLE_STRING,
.scope = OPTIONS_TABLE_SERVER,
.default_str = "screen"
},
{ .name = "escape-time",
.type = OPTIONS_TABLE_NUMBER,
.scope = OPTIONS_TABLE_SERVER,
.minimum = 0,
.maximum = INT_MAX,
.default_num = 500
},
{ .name = "exit-unattached",
.type = OPTIONS_TABLE_FLAG,
.scope = OPTIONS_TABLE_SERVER,
.default_num = 0
},
{ .name = "focus-events",
.type = OPTIONS_TABLE_FLAG,
.scope = OPTIONS_TABLE_SERVER,
.default_num = 0
},
{ .name = "history-file",
.type = OPTIONS_TABLE_STRING,
.scope = OPTIONS_TABLE_SERVER,
.default_str = ""
},
{ .name = "message-limit",
.type = OPTIONS_TABLE_NUMBER,
.scope = OPTIONS_TABLE_SERVER,
.minimum = 0,
.maximum = INT_MAX,
.default_num = 100
},
{ .name = "quiet",
.type = OPTIONS_TABLE_FLAG,
.scope = OPTIONS_TABLE_SERVER,
.default_num = 0
},
{ .name = "set-clipboard",
.type = OPTIONS_TABLE_FLAG,
.scope = OPTIONS_TABLE_SERVER,
.default_num = 1
},
{ .name = "terminal-overrides",
.type = OPTIONS_TABLE_STRING,
.scope = OPTIONS_TABLE_SERVER,
.default_str = "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 = "assume-paste-time",
.type = OPTIONS_TABLE_NUMBER,
.scope = OPTIONS_TABLE_SESSION,
.minimum = 0,
.maximum = INT_MAX,
.default_num = 1,
},
{ .name = "base-index",
.type = OPTIONS_TABLE_NUMBER,
.scope = OPTIONS_TABLE_SESSION,
.minimum = 0,
.maximum = INT_MAX,
.default_num = 0
},
{ .name = "bell-action",
.type = OPTIONS_TABLE_CHOICE,
.scope = OPTIONS_TABLE_SESSION,
.choices = options_table_bell_action_list,
.default_num = BELL_ANY
},
{ .name = "bell-on-alert",
.type = OPTIONS_TABLE_FLAG,
.scope = OPTIONS_TABLE_SESSION,
.default_num = 0
},
{ .name = "default-command",
.type = OPTIONS_TABLE_STRING,
.scope = OPTIONS_TABLE_SESSION,
.default_str = ""
},
{ .name = "default-shell",
.type = OPTIONS_TABLE_STRING,
.scope<