use crate::*;
static OPTIONS_TABLE_MODE_KEYS_LIST: [&str; 2] = ["emacs", "vi"];
static OPTIONS_TABLE_CLOCK_MODE_STYLE_LIST: [&str; 2] = ["12", "24"];
static OPTIONS_TABLE_STATUS_LIST: [&str; 6] = ["off", "on", "2", "3", "4", "5"];
static OPTIONS_TABLE_MESSAGE_LINE_LIST: [&str; 5] = ["0", "1", "2", "3", "4"];
static OPTIONS_TABLE_STATUS_KEYS_LIST: [&str; 2] = ["emacs", "vi"];
static OPTIONS_TABLE_STATUS_JUSTIFY_LIST: [&str; 4] =
["left", "centre", "right", "absolute-centre"];
static OPTIONS_TABLE_STATUS_POSITION_LIST: [&str; 2] = ["top", "bottom"];
static OPTIONS_TABLE_BELL_ACTION_LIST: [&str; 4] = ["none", "any", "current", "other"];
static OPTIONS_TABLE_VISUAL_BELL_LIST: [&str; 3] = ["off", "on", "both"];
static OPTIONS_TABLE_CURSOR_STYLE_LIST: [&str; 7] = [
"default",
"blinking-block",
"block",
"blinking-underline",
"underline",
"blinking-bar",
"bar",
];
static OPTIONS_TABLE_PANE_STATUS_LIST: [&str; 3] = ["off", "top", "bottom"];
static OPTIONS_TABLE_PANE_BORDER_INDICATORS_LIST: [&str; 4] = ["off", "colour", "arrows", "both"];
static OPTIONS_TABLE_PANE_BORDER_LINES_LIST: [&str; 5] =
["single", "double", "heavy", "simple", "number"];
static OPTIONS_TABLE_POPUP_BORDER_LINES_LIST: [&str; 7] = [
"single", "double", "heavy", "simple", "rounded", "padded", "none",
];
static OPTIONS_TABLE_GET_CLIPBOARD_LIST: [&str; 4] = ["off", "buffer", "request", "both"];
static OPTIONS_TABLE_THEME_LIST: [&str; 4] = ["detect", "terminal", "light", "dark"];
static OPTIONS_TABLE_SET_CLIPBOARD_LIST: [&str; 3] = ["off", "external", "on"];
static OPTIONS_TABLE_WINDOW_SIZE_LIST: [&str; 4] = ["largest", "smallest", "manual", "latest"];
static OPTIONS_TABLE_REMAIN_ON_EXIT_LIST: [&str; 3] = ["off", "on", "failed"];
static OPTIONS_TABLE_DESTROY_UNATTACHED_LIST: [&str; 4] = ["off", "on", "keep-last", "keep-group"];
static OPTIONS_TABLE_DETACH_ON_DESTROY_LIST: [&str; 5] =
["off", "on", "no-detached", "previous", "next"];
static OPTIONS_TABLE_EXTENDED_KEYS_LIST: [&str; 3] = ["off", "on", "always"];
static OPTIONS_TABLE_EXTENDED_KEYS_FORMAT_LIST: [&str; 2] = ["csi-u", "xterm"];
static OPTIONS_TABLE_ALLOW_PASSTHROUGH_LIST: [&str; 3] = ["off", "on", "all"];
#[rustfmt::skip]
pub static OPTIONS_OTHER_NAMES: [options_name_map; 5] = [
options_name_map::new("display-panes-color", "display-panes-colour"),
options_name_map::new("display-panes-active-color", "display-panes-active-colour"),
options_name_map::new("clock-mode-color", "clock-mode-colour"),
options_name_map::new("cursor-color", "cursor-colour"),
options_name_map::new("pane-colors", "pane-colours"),
];
#[rustfmt::skip]
pub static OPTIONS_OTHER_NAMES_STR: [options_name_map_str; 5] = [
options_name_map_str::new("display-panes-color", "display-panes-colour"),
options_name_map_str::new("display-panes-active-color", "display-panes-active-colour"),
options_name_map_str::new("clock-mode-color", "clock-mode-colour"),
options_name_map_str::new("cursor-color", "cursor-colour"),
options_name_map_str::new("pane-colors", "pane-colours"),
];
#[expect(clippy::disallowed_methods)]
pub const OPTIONS_TABLE_STATUS_FORMAT1: *const u8 = concat!(
"#[align=left range=left #{E:status-left-style}]",
"#[push-default]",
"#{T;=/#{status-left-length}:status-left}",
"#[pop-default]",
"#[norange default]",
"#[list=on align=#{status-justify}]",
"#[list=left-marker]<#[list=right-marker]>#[list=on]",
"#{W:",
"#[range=window|#{window_index} ",
"#{E:window-status-style}",
"#{?#{&&:#{window_last_flag},",
"#{!=:#{E:window-status-last-style},default}}, ",
"#{E:window-status-last-style},",
"}",
"#{?#{&&:#{window_bell_flag},",
"#{!=:#{E:window-status-bell-style},default}}, ",
"#{E:window-status-bell-style},",
"#{?#{&&:#{||:#{window_activity_flag},",
"#{window_silence_flag}},",
"#{!=:",
"#{E:window-status-activity-style},",
"default}}, ",
"#{E:window-status-activity-style},",
"}",
"}",
"]",
"#[push-default]",
"#{T:window-status-format}",
"#[pop-default]",
"#[norange default]",
"#{?loop_last_flag,,#{E:window-status-separator}}",
",",
"#[range=window|#{window_index} list=focus ",
"#{?#{!=:#{E:window-status-current-style},default},",
"#{E:window-status-current-style},",
"#{E:window-status-style}",
"}",
"#{?#{&&:#{window_last_flag},",
"#{!=:#{E:window-status-last-style},default}}, ",
"#{E:window-status-last-style},",
"}",
"#{?#{&&:#{window_bell_flag},",
"#{!=:#{E:window-status-bell-style},default}}, ",
"#{E:window-status-bell-style},",
"#{?#{&&:#{||:#{window_activity_flag},",
"#{window_silence_flag}},",
"#{!=:",
"#{E:window-status-activity-style},",
"default}}, ",
"#{E:window-status-activity-style},",
"}",
"}",
"]",
"#[push-default]",
"#{T:window-status-current-format}",
"#[pop-default]",
"#[norange list=on default]",
"#{?loop_last_flag,,#{E:window-status-separator}}",
"}",
"#[nolist align=right range=right #{E:status-right-style}]",
"#[push-default]",
"#{T;=/#{status-right-length}:status-right}",
"#[pop-default]",
"#[norange default]\0"
)
.as_ptr()
.cast();
#[expect(clippy::disallowed_methods)]
pub const OPTIONS_TABLE_STATUS_FORMAT2: *const u8 = concat!(
"#[align=left]#{R: ,#{n:#{session_name}}}P: ",
"#[norange default]",
"#[list=on align=#{status-justify}]",
"#[list=left-marker]<#[list=right-marker]>#[list=on]",
"#{P:",
"#[range=pane|#{pane_id} ",
"#{E:pane-status-style}",
"]",
"#[push-default]",
"#{T:window-pane-status-format}",
"#[pop-default]",
"#[norange list=on default] ",
",",
"#[range=pane|#{pane_id} list=focus ",
"#{?#{!=:#{E:pane-status-current-style},default},",
"#{E:pane-status-current-style},",
"#{E:pane-status-style}",
"}",
"]",
"#[push-default]",
"#{T:window-pane-current-status-format}",
"#[pop-default]",
"#[norange list=on default] ",
"}\0"
)
.as_ptr()
.cast();
#[expect(clippy::disallowed_methods)]
pub const OPTIONS_TABLE_STATUS_FORMAT3: *const u8 = concat!(
"#[align=left]#{R: ,#{n:#{session_name}}}S: ",
"#[norange default]",
"#[list=on align=#{status-justify}]",
"#[list=left-marker]<#[list=right-marker]>#[list=on]",
"#{S:",
"#[range=session|#{session_id} ",
"#{E:session-status-style}",
"]",
"#[push-default]",
"#S#{session_alert}",
"#[pop-default]",
"#[norange list=on default] ",
",",
"#[range=session|#{session_id} list=focus ",
"#{?#{!=:#{E:session-status-current-style},default},",
"#{E:session-status-current-style},",
"#{E:session-status-style}",
"}",
"]",
"#[push-default]",
"#S*#{session_alert}",
"#[pop-default]",
"#[norange list=on default] ",
"}\0"
)
.as_ptr()
.cast();
pub static mut OPTIONS_TABLE_STATUS_FORMAT_DEFAULT: [*const u8; 4] = [
OPTIONS_TABLE_STATUS_FORMAT1,
OPTIONS_TABLE_STATUS_FORMAT2,
OPTIONS_TABLE_STATUS_FORMAT3,
null(),
];
macro_rules! options_table_hook {
($hook_name:expr, $default_value:expr) => {
options_table_entry {
name: $hook_name,
type_: options_table_type::OPTIONS_TABLE_COMMAND,
scope: OPTIONS_TABLE_SESSION,
flags: OPTIONS_TABLE_IS_ARRAY | OPTIONS_TABLE_IS_HOOK,
default_str: Some($default_value),
separator: c!(""),
..options_table_entry::const_default()
}
};
}
macro_rules! options_table_pane_hook {
($hook_name:expr, $default_value:expr) => {
options_table_entry {
name: $hook_name,
type_: options_table_type::OPTIONS_TABLE_COMMAND,
scope: OPTIONS_TABLE_WINDOW | OPTIONS_TABLE_PANE,
flags: OPTIONS_TABLE_IS_ARRAY | OPTIONS_TABLE_IS_HOOK,
default_str: Some($default_value),
separator: c!(""),
..options_table_entry::const_default()
}
};
}
macro_rules! options_table_window_hook {
($hook_name:expr, $default_value:expr) => {
options_table_entry {
name: $hook_name,
type_: options_table_type::OPTIONS_TABLE_COMMAND,
scope: OPTIONS_TABLE_WINDOW,
flags: OPTIONS_TABLE_IS_ARRAY | OPTIONS_TABLE_IS_HOOK,
default_str: Some($default_value),
separator: c!(""),
..options_table_entry::const_default()
}
};
}
pub static OPTIONS_TABLE: [options_table_entry; 226] = [
options_table_entry {
name: "backspace",
type_: options_table_type::OPTIONS_TABLE_KEY,
scope: OPTIONS_TABLE_SERVER,
default_num: b'\x7f' as i64,
text: c!("The key to send for backspace."),
choices: &[],
..options_table_entry::const_default()
},
options_table_entry {
name: "buffer-limit",
type_: options_table_type::OPTIONS_TABLE_NUMBER,
scope: OPTIONS_TABLE_SERVER,
minimum: 1,
maximum: i32::MAX as u32,
default_num: 50,
text: c!(
"The maximum number of automatic buffers. When this is reached, the oldest buffer is deleted."
),
choices: &[],
..options_table_entry::const_default()
},
options_table_entry {
name: "codepoint-widths",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
flags: OPTIONS_TABLE_IS_ARRAY,
default_str: Some(""),
separator: c!(","),
text: c!("Array of override widths for Unicode codepoints."),
..options_table_entry::const_default()
},
options_table_entry {
name: "variation-selector-always-wide",
type_: options_table_type::OPTIONS_TABLE_FLAG,
scope: OPTIONS_TABLE_SERVER,
default_num: 1,
text: c!(
"If the Unicode VS16 codepoint should always be treated as a wide character."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "command-alias",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
flags: OPTIONS_TABLE_IS_ARRAY,
default_str: Some(
"split-pane=split-window,splitp=split-window,server-info=show-messages -JT,info=show-messages -JT,choose-window=choose-tree -w,choose-session=choose-tree -s",
),
separator: c!(","),
text: c!(
"Array of command aliases. Each entry is an alias and a command separated by '='."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "copy-command",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
default_str: Some(""),
text: c!("Shell command run when text is copied. If empty, no command is run."),
..options_table_entry::const_default()
},
options_table_entry {
name: "cursor-colour",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW | OPTIONS_TABLE_PANE,
default_str: Some(""),
flags: OPTIONS_TABLE_IS_COLOUR,
text: c!("Colour of the cursor."),
..options_table_entry::const_default()
},
options_table_entry {
name: "cursor-style",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_WINDOW | OPTIONS_TABLE_PANE,
choices: &OPTIONS_TABLE_CURSOR_STYLE_LIST,
default_num: 0,
text: c!("Style of the cursor."),
..options_table_entry::const_default()
},
options_table_entry {
name: "default-terminal",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
default_str: Some(TMUX_TERM),
text: c!("Default for the 'TERM' environment variable."),
..options_table_entry::const_default()
},
options_table_entry {
name: "editor",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
default_str: Some(_PATH_VI),
text: c!("Editor run to edit files."),
..options_table_entry::const_default()
},
options_table_entry {
name: "escape-time",
type_: options_table_type::OPTIONS_TABLE_NUMBER,
scope: OPTIONS_TABLE_SERVER,
minimum: 0,
maximum: i32::MAX as u32,
default_num: 10,
unit: c!("milliseconds"),
text: c!("Time to wait before assuming a key is Escape."),
..options_table_entry::const_default()
},
options_table_entry {
name: "exit-empty",
type_: options_table_type::OPTIONS_TABLE_FLAG,
scope: OPTIONS_TABLE_SERVER,
default_num: 1,
text: c!("Whether the server should exit if there are no sessions."),
..options_table_entry::const_default()
},
options_table_entry {
name: "exit-unattached",
type_: options_table_type::OPTIONS_TABLE_FLAG,
scope: OPTIONS_TABLE_SERVER,
default_num: 0,
text: c!("Whether the server should exit if there are no attached clients."),
..options_table_entry::const_default()
},
options_table_entry {
name: "extended-keys",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_SERVER,
choices: &OPTIONS_TABLE_EXTENDED_KEYS_LIST,
default_num: 0,
text: c!("Whether to request extended key sequences from terminals that support it."),
..options_table_entry::const_default()
},
options_table_entry {
name: "extended-keys-format",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_SERVER,
choices: &OPTIONS_TABLE_EXTENDED_KEYS_FORMAT_LIST,
default_num: 1,
text: c!("The format of emitted extended key sequences."),
..options_table_entry::const_default()
},
options_table_entry {
name: "focus-events",
type_: options_table_type::OPTIONS_TABLE_FLAG,
scope: OPTIONS_TABLE_SERVER,
default_num: 0,
text: c!("Whether to send focus events to applications."),
..options_table_entry::const_default()
},
options_table_entry {
name: "history-file",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
default_str: Some(""),
text: c!(
"Location of the command prompt history file. Empty does not write a history file."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "input-buffer-size",
type_: options_table_type::OPTIONS_TABLE_NUMBER,
scope: OPTIONS_TABLE_SERVER,
minimum: INPUT_BUF_DEFAULT_SIZE as u32,
maximum: u32::MAX,
default_num: INPUT_BUF_DEFAULT_SIZE as i64,
text: c!("Number of bytes accepted in a single input before dropping."),
..options_table_entry::const_default()
},
options_table_entry {
name: "menu-style",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
flags: OPTIONS_TABLE_IS_STYLE,
default_str: Some("bg=themedarkgrey,fg=themewhite"),
separator: c!(","),
text: c!("Default style of menu."),
..options_table_entry::const_default()
},
options_table_entry {
name: "menu-selected-style",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
flags: OPTIONS_TABLE_IS_STYLE,
default_str: Some("bg=themeyellow,fg=themeblack"),
separator: c!(","),
text: c!("Default style of selected menu item."),
..options_table_entry::const_default()
},
options_table_entry {
name: "menu-border-style",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some("bg=themedarkgrey,fg=themelightgrey"),
flags: OPTIONS_TABLE_IS_STYLE,
separator: c!(","),
text: c!("Default style of menu borders."),
..options_table_entry::const_default()
},
options_table_entry {
name: "menu-border-lines",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_WINDOW,
choices: &OPTIONS_TABLE_POPUP_BORDER_LINES_LIST,
default_num: box_lines::BOX_LINES_SINGLE as i64,
text: c!(
"Type of characters used to draw menu border lines. Some of these are only supported on terminals with UTF-8 support."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "message-limit",
type_: options_table_type::OPTIONS_TABLE_NUMBER,
scope: OPTIONS_TABLE_SERVER,
minimum: 0,
maximum: i32::MAX as u32,
default_num: 1000,
text: c!("Maximum number of server messages to keep."),
..options_table_entry::const_default()
},
options_table_entry {
name: "prefix-timeout",
type_: options_table_type::OPTIONS_TABLE_NUMBER,
scope: OPTIONS_TABLE_SERVER,
minimum: 0,
maximum: i32::MAX as u32,
default_num: 0,
unit: c!("milliseconds"),
text: c!(
"The timeout for the prefix key if no subsequent key is pressed. Zero means disabled."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "prompt-history-limit",
type_: options_table_type::OPTIONS_TABLE_NUMBER,
scope: OPTIONS_TABLE_SERVER,
minimum: 0,
maximum: i32::MAX as u32,
default_num: 100,
text: c!("Maximum number of commands to keep in history."),
..options_table_entry::const_default()
},
options_table_entry {
name: "theme",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_SERVER,
choices: &OPTIONS_TABLE_THEME_LIST,
default_num: 0,
text: c!(
"Whether tmux should detect the terminal theme, use terminal ANSI colours, or force the light or dark theme."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "dark-theme-black",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
flags: OPTIONS_TABLE_IS_COLOUR,
default_str: Some("#{?#{e|>=:#{client_colours},256},gray5,black}"),
text: c!("Dark theme colour for black."),
..options_table_entry::const_default()
},
options_table_entry {
name: "dark-theme-white",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
flags: OPTIONS_TABLE_IS_COLOUR,
default_str: Some("#{?#{e|>=:#{client_colours},256},gray90,white}"),
text: c!("Dark theme colour for white."),
..options_table_entry::const_default()
},
options_table_entry {
name: "dark-theme-light-grey",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
flags: OPTIONS_TABLE_IS_COLOUR,
default_str: Some("#{?#{e|>=:#{client_colours},256},gray70,white}"),
text: c!("Dark theme colour for light grey."),
..options_table_entry::const_default()
},
options_table_entry {
name: "dark-theme-dark-grey",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
flags: OPTIONS_TABLE_IS_COLOUR,
default_str: Some("#{?#{e|>=:#{client_colours},256},gray15,black}"),
text: c!("Dark theme colour for dark grey."),
..options_table_entry::const_default()
},
options_table_entry {
name: "dark-theme-green",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
flags: OPTIONS_TABLE_IS_COLOUR,
default_str: Some("#{?#{e|>=:#{client_colours},256},yellowgreen,green}"),
text: c!("Dark theme colour for green."),
..options_table_entry::const_default()
},
options_table_entry {
name: "dark-theme-yellow",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
flags: OPTIONS_TABLE_IS_COLOUR,
default_str: Some("#{?#{e|>=:#{client_colours},256},darkgoldenrod,yellow}"),
text: c!("Dark theme colour for yellow."),
..options_table_entry::const_default()
},
options_table_entry {
name: "dark-theme-red",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
flags: OPTIONS_TABLE_IS_COLOUR,
default_str: Some("#{?#{e|>=:#{client_colours},256},indianred,red}"),
text: c!("Dark theme colour for red."),
..options_table_entry::const_default()
},
options_table_entry {
name: "dark-theme-blue",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
flags: OPTIONS_TABLE_IS_COLOUR,
default_str: Some("#{?#{e|>=:#{client_colours},256},skyblue3,blue}"),
text: c!("Dark theme colour for blue."),
..options_table_entry::const_default()
},
options_table_entry {
name: "dark-theme-cyan",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
flags: OPTIONS_TABLE_IS_COLOUR,
default_str: Some("#{?#{e|>=:#{client_colours},256},cadetblue,cyan}"),
text: c!("Dark theme colour for cyan."),
..options_table_entry::const_default()
},
options_table_entry {
name: "dark-theme-magenta",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
flags: OPTIONS_TABLE_IS_COLOUR,
default_str: Some("#{?#{e|>=:#{client_colours},256},mediumpurple,magenta}"),
text: c!("Dark theme colour for magenta."),
..options_table_entry::const_default()
},
options_table_entry {
name: "light-theme-black",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
flags: OPTIONS_TABLE_IS_COLOUR,
default_str: Some("#{?#{e|>=:#{client_colours},256},gray10,black}"),
text: c!("Light theme colour for black."),
..options_table_entry::const_default()
},
options_table_entry {
name: "light-theme-white",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
flags: OPTIONS_TABLE_IS_COLOUR,
default_str: Some("#{?#{e|>=:#{client_colours},256},gray95,white}"),
text: c!("Light theme colour for white."),
..options_table_entry::const_default()
},
options_table_entry {
name: "light-theme-light-grey",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
flags: OPTIONS_TABLE_IS_COLOUR,
default_str: Some("#{?#{e|>=:#{client_colours},256},gray80,white}"),
text: c!("Light theme colour for light grey."),
..options_table_entry::const_default()
},
options_table_entry {
name: "light-theme-dark-grey",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
flags: OPTIONS_TABLE_IS_COLOUR,
default_str: Some("#{?#{e|>=:#{client_colours},256},gray45,black}"),
text: c!("Light theme colour for dark grey."),
..options_table_entry::const_default()
},
options_table_entry {
name: "light-theme-green",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
flags: OPTIONS_TABLE_IS_COLOUR,
default_str: Some("#{?#{e|>=:#{client_colours},256},seagreen,green}"),
text: c!("Light theme colour for green."),
..options_table_entry::const_default()
},
options_table_entry {
name: "light-theme-yellow",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
flags: OPTIONS_TABLE_IS_COLOUR,
default_str: Some("#{?#{e|>=:#{client_colours},256},darkgoldenrod,yellow}"),
text: c!("Light theme colour for yellow."),
..options_table_entry::const_default()
},
options_table_entry {
name: "light-theme-red",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
flags: OPTIONS_TABLE_IS_COLOUR,
default_str: Some("#{?#{e|>=:#{client_colours},256},indianred4,red}"),
text: c!("Light theme colour for red."),
..options_table_entry::const_default()
},
options_table_entry {
name: "light-theme-blue",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
flags: OPTIONS_TABLE_IS_COLOUR,
default_str: Some("#{?#{e|>=:#{client_colours},256},steelblue,blue}"),
text: c!("Light theme colour for blue."),
..options_table_entry::const_default()
},
options_table_entry {
name: "light-theme-cyan",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
flags: OPTIONS_TABLE_IS_COLOUR,
default_str: Some("#{?#{e|>=:#{client_colours},256},darkcyan,cyan}"),
text: c!("Light theme colour for cyan."),
..options_table_entry::const_default()
},
options_table_entry {
name: "light-theme-magenta",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
flags: OPTIONS_TABLE_IS_COLOUR,
default_str: Some("#{?#{e|>=:#{client_colours},256},purple4,magenta}"),
text: c!("Light theme colour for magenta."),
..options_table_entry::const_default()
},
options_table_entry {
name: "get-clipboard",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_SERVER,
choices: &OPTIONS_TABLE_GET_CLIPBOARD_LIST,
default_num: 1,
text: c!(
"When an application requests the clipboard, whether to ignore the request ('off'); respond with the newest buffer ('buffer'); request the clipboard from the most recently used terminal ('request'); or to request the clipboard, create a buffer, and send it to the application ('both')."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "set-clipboard",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_SERVER,
choices: &OPTIONS_TABLE_SET_CLIPBOARD_LIST,
default_num: 1,
text: c!(
"Whether to attempt to set the system clipboard ('on' or 'external') and whether to allow applications to create paste buffers with an escape sequence ('on' only)."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "terminal-overrides",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
flags: OPTIONS_TABLE_IS_ARRAY,
default_str: Some("linux*:AX@"),
separator: c!(","),
text: c!("List of terminal capabilities overrides."),
..options_table_entry::const_default()
},
options_table_entry {
name: "terminal-features",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
flags: OPTIONS_TABLE_IS_ARRAY,
default_str: Some(
"xterm*:clipboard:ccolour:cstyle:focus:title,screen*:title,rxvt*:ignorefkeys",
),
separator: c!(","),
text: c!("List of terminal features, used if they cannot be automatically detected."),
..options_table_entry::const_default()
},
options_table_entry {
name: "user-keys",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SERVER,
flags: OPTIONS_TABLE_IS_ARRAY,
default_str: Some(""),
separator: c!(","),
text: c!(
"User key assignments. Each sequence in the list is translated into a key: 'User0', 'User1' and so on."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "activity-action",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_SESSION,
choices: &OPTIONS_TABLE_BELL_ACTION_LIST,
default_num: alert_option::ALERT_OTHER as i64,
text: c!("Action to take on an activity alert."),
..options_table_entry::const_default()
},
options_table_entry {
name: "assume-paste-time",
type_: options_table_type::OPTIONS_TABLE_NUMBER,
scope: OPTIONS_TABLE_SESSION,
minimum: 0,
maximum: i32::MAX as u32,
default_num: 1,
unit: c!("milliseconds"),
text: c!("Maximum time between input to assume it is pasting rather than typing."),
..options_table_entry::const_default()
},
options_table_entry {
name: "base-index",
type_: options_table_type::OPTIONS_TABLE_NUMBER,
scope: OPTIONS_TABLE_SESSION,
minimum: 0,
maximum: i32::MAX as u32,
default_num: 0,
text: c!("Default index of the first window in each session."),
..options_table_entry::const_default()
},
options_table_entry {
name: "bell-action",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_SESSION,
choices: &OPTIONS_TABLE_BELL_ACTION_LIST,
default_num: alert_option::ALERT_ANY as i64,
text: c!("Action to take on a bell alert."),
..options_table_entry::const_default()
},
options_table_entry {
name: "default-command",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SESSION,
default_str: Some(""),
text: c!("Default command to run in new panes. If empty, a shell is started."),
..options_table_entry::const_default()
},
options_table_entry {
name: "default-client-command",
type_: options_table_type::OPTIONS_TABLE_COMMAND,
scope: OPTIONS_TABLE_SERVER,
default_str: Some("new-session"),
text: c!("Default command to run when tmux is run without a command."),
..options_table_entry::const_default()
},
options_table_entry {
name: "default-shell",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SESSION,
default_str: Some(_PATH_BSHELL_STR),
text: c!("Location of default shell."),
..options_table_entry::const_default()
},
options_table_entry {
name: "default-size",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SESSION,
pattern: c!("[0-9]*x[0-9]*"),
default_str: Some("80x24"),
text: c!("Initial size of new sessions."),
..options_table_entry::const_default()
},
options_table_entry {
name: "destroy-unattached",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_SESSION,
choices: &OPTIONS_TABLE_DESTROY_UNATTACHED_LIST,
default_num: 0,
text: c!(
"Whether to destroy sessions when they have no attached clients, or keep the last session whether in the group."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "detach-on-destroy",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_SESSION,
choices: &OPTIONS_TABLE_DETACH_ON_DESTROY_LIST,
default_num: 1,
text: c!(
"Whether to detach when a session is destroyed, or switch the client to another session if any exist."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "display-panes-active-colour",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SESSION,
default_str: Some("themered"),
flags: OPTIONS_TABLE_IS_COLOUR,
text: c!("Colour of the active pane for 'display-panes'."),
..options_table_entry::const_default()
},
options_table_entry {
name: "display-panes-colour",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SESSION,
default_str: Some("themeblue"),
flags: OPTIONS_TABLE_IS_COLOUR,
text: c!("Colour of not active panes for 'display-panes'."),
..options_table_entry::const_default()
},
options_table_entry {
name: "display-panes-format",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SESSION,
default_str: Some("#[align=right]#{pane_width}x#{pane_height}"),
text: c!("Format of text shown by 'display-panes', expanded for each pane."),
..options_table_entry::const_default()
},
options_table_entry {
name: "display-panes-time",
type_: options_table_type::OPTIONS_TABLE_NUMBER,
scope: OPTIONS_TABLE_SESSION,
minimum: 1,
maximum: i32::MAX as u32,
default_num: 1000,
unit: c!("milliseconds"),
text: c!("Time for which 'display-panes' should show pane numbers."),
..options_table_entry::const_default()
},
options_table_entry {
name: "display-time",
type_: options_table_type::OPTIONS_TABLE_NUMBER,
scope: OPTIONS_TABLE_SESSION,
minimum: 0,
maximum: i32::MAX as u32,
default_num: 750,
unit: c!("milliseconds"),
text: c!("Time for which status line messages should appear."),
..options_table_entry::const_default()
},
options_table_entry {
name: "focus-follows-mouse",
type_: options_table_type::OPTIONS_TABLE_FLAG,
scope: OPTIONS_TABLE_SESSION,
default_num: 0,
text: c!("Whether moving the mouse into a pane selects it."),
..options_table_entry::const_default()
},
options_table_entry {
name: "history-limit",
type_: options_table_type::OPTIONS_TABLE_NUMBER,
scope: OPTIONS_TABLE_SESSION,
minimum: 0,
maximum: i32::MAX as u32,
default_num: 2000,
unit: c!("lines"),
text: c!(
"Maximum number of lines to keep in the history for each pane. If changed, the new value applies only to new panes."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "initial-repeat-time",
type_: options_table_type::OPTIONS_TABLE_NUMBER,
scope: OPTIONS_TABLE_SESSION,
minimum: 0,
maximum: 2000000,
default_num: 0,
unit: c!("milliseconds"),
text: c!(
"Time to wait for a key binding to repeat the first time the key is \
pressed, if it is bound with the '-r' flag. Subsequent presses use \
the 'repeat-time' option."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "key-table",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SESSION,
default_str: Some("root"),
text: c!("Default key table. Key presses are first looked up in this table."),
..options_table_entry::const_default()
},
options_table_entry {
name: "lock-after-time",
type_: options_table_type::OPTIONS_TABLE_NUMBER,
scope: OPTIONS_TABLE_SESSION,
minimum: 0,
maximum: i32::MAX as u32,
default_num: 0,
unit: c!("seconds"),
text: c!("Time after which a client is locked if not used."),
..options_table_entry::const_default()
},
options_table_entry {
name: "lock-command",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SESSION,
default_str: Some(TMUX_LOCK_CMD),
text: c!("Shell command to run to lock a client."),
..options_table_entry::const_default()
},
options_table_entry {
name: "message-command-style",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SESSION,
default_str: Some("bg=themeblack,fg=themeyellow,#{?#{m/r:(^|#,)IS(PANE|MODE)($|#,),#{prompt_flags}},,fill=themeblack}"),
flags: OPTIONS_TABLE_IS_STYLE,
separator: c!(","),
text: c!(
"Style of the command prompt when in command mode, if 'mode-keys' is set to 'vi'."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "message-line",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_SESSION,
choices: &OPTIONS_TABLE_MESSAGE_LINE_LIST,
default_num: 0,
text: c!("Position (line) of messages and the command prompt."),
..options_table_entry::const_default()
},
options_table_entry {
name: "message-style",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SESSION,
default_str: Some("bg=themeyellow,fg=themeblack,#{?#{m/r:(^|#,)IS(PANE|MODE)($|#,),#{prompt_flags}},,fill=themeyellow}"),
flags: OPTIONS_TABLE_IS_STYLE,
separator: c!(","),
text: c!("Style of messages and the command prompt."),
..options_table_entry::const_default()
},
options_table_entry {
name: "mouse",
type_: options_table_type::OPTIONS_TABLE_FLAG,
scope: OPTIONS_TABLE_SESSION,
default_num: 0,
text: c!(
"Whether the mouse is recognised and mouse key bindings are executed. Applications inside panes can use the mouse even when 'off'."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "prefix",
type_: options_table_type::OPTIONS_TABLE_KEY,
scope: OPTIONS_TABLE_SESSION,
default_num: b'b' as i64 | KEYC_CTRL as i64,
text: c!("The prefix key."),
..options_table_entry::const_default()
},
options_table_entry {
name: "prefix2",
type_: options_table_type::OPTIONS_TABLE_KEY,
scope: OPTIONS_TABLE_SESSION,
default_num: KEYC_NONE as i64,
text: c!("A second prefix key."),
..options_table_entry::const_default()
},
options_table_entry {
name: "renumber-windows",
type_: options_table_type::OPTIONS_TABLE_FLAG,
scope: OPTIONS_TABLE_SESSION,
default_num: 0,
text: c!("Whether windows are automatically renumbered rather than leaving gaps."),
..options_table_entry::const_default()
},
options_table_entry {
name: "repeat-time",
type_: options_table_type::OPTIONS_TABLE_NUMBER,
scope: OPTIONS_TABLE_SESSION,
minimum: 0,
maximum: i16::MAX as u32,
default_num: 500,
unit: c!("milliseconds"),
text: c!("Time to wait for a key binding to repeat, if it is bound with the '-r' flag."),
..options_table_entry::const_default()
},
options_table_entry {
name: "set-titles",
type_: options_table_type::OPTIONS_TABLE_FLAG,
scope: OPTIONS_TABLE_SESSION,
default_num: 0,
text: c!("Whether to set the terminal title, if supported."),
..options_table_entry::const_default()
},
options_table_entry {
name: "set-titles-string",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SESSION,
default_str: Some("#S:#I:#W - \"#T\" #{session_alerts}"),
text: c!("Format of the terminal title to set."),
..options_table_entry::const_default()
},
options_table_entry {
name: "silence-action",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_SESSION,
choices: &OPTIONS_TABLE_BELL_ACTION_LIST,
default_num: alert_option::ALERT_OTHER as i64,
text: c!("Action to take on a silence alert."),
..options_table_entry::const_default()
},
options_table_entry {
name: "status",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_SESSION,
choices: &OPTIONS_TABLE_STATUS_LIST,
default_num: 1,
text: c!("Number of lines in the status line."),
..options_table_entry::const_default()
},
options_table_entry {
name: "status-bg",
type_: options_table_type::OPTIONS_TABLE_COLOUR,
scope: OPTIONS_TABLE_SESSION,
default_num: 8,
text: c!(
"Background colour of the status line. This option is deprecated, use 'status-style' instead."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "status-fg",
type_: options_table_type::OPTIONS_TABLE_COLOUR,
scope: OPTIONS_TABLE_SESSION,
default_num: 8,
text: c!(
"Foreground colour of the status line. This option is deprecated, use 'status-style' instead."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "status-format",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SESSION,
flags: OPTIONS_TABLE_IS_ARRAY,
default_arr: &raw const OPTIONS_TABLE_STATUS_FORMAT_DEFAULT as *const *const u8,
text: c!(
"Formats for the status lines. Each array member is the format for one status line. The default status line is made up of several components which may be configured individually with other options such as 'status-left'."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "status-interval",
type_: options_table_type::OPTIONS_TABLE_NUMBER,
scope: OPTIONS_TABLE_SESSION,
minimum: 0,
maximum: i32::MAX as u32,
default_num: 15,
unit: c!("seconds"),
text: c!("Number of seconds between status line updates."),
..options_table_entry::const_default()
},
options_table_entry {
name: "status-justify",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_SESSION,
choices: &OPTIONS_TABLE_STATUS_JUSTIFY_LIST,
default_num: 0,
text: c!("Position of the window list in the status line."),
..options_table_entry::const_default()
},
options_table_entry {
name: "status-keys",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_SESSION,
choices: &OPTIONS_TABLE_STATUS_KEYS_LIST,
default_num: modekey::MODEKEY_EMACS as i64,
text: c!("Key set to use at the command prompt."),
..options_table_entry::const_default()
},
options_table_entry {
name: "status-left",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SESSION,
default_str: Some("[#{session_name}] "),
text: c!("Contents of the left side of the status line."),
..options_table_entry::const_default()
},
options_table_entry {
name: "status-left-length",
type_: options_table_type::OPTIONS_TABLE_NUMBER,
scope: OPTIONS_TABLE_SESSION,
minimum: 0,
maximum: i16::MAX as u32,
default_num: 10,
text: c!("Maximum width of the left side of the status line."),
..options_table_entry::const_default()
},
options_table_entry {
name: "status-left-style",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SESSION,
default_str: Some("default"),
flags: OPTIONS_TABLE_IS_STYLE,
separator: c!(","),
text: c!("Style of the left side of the status line."),
..options_table_entry::const_default()
},
options_table_entry {
name: "status-position",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_SESSION,
choices: &OPTIONS_TABLE_STATUS_POSITION_LIST,
default_num: 1,
text: c!("Position of the status line."),
..options_table_entry::const_default()
},
options_table_entry {
name: "status-right",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SESSION,
default_str: Some(
"#{?window_bigger,[#{window_offset_x}#,#{window_offset_y}] ,}\"#{=21:pane_title}\" %H:%M %d-%b-%y",
),
text: c!("Contents of the right side of the status line."),
..options_table_entry::const_default()
},
options_table_entry {
name: "status-right-length",
type_: options_table_type::OPTIONS_TABLE_NUMBER,
scope: OPTIONS_TABLE_SESSION,
minimum: 0,
maximum: i16::MAX as u32,
default_num: 40,
text: c!("Maximum width of the right side of the status line."),
..options_table_entry::const_default()
},
options_table_entry {
name: "status-right-style",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SESSION,
default_str: Some("default"),
flags: OPTIONS_TABLE_IS_STYLE,
separator: c!(","),
text: c!("Style of the right side of the status line."),
..options_table_entry::const_default()
},
options_table_entry {
name: "status-style",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SESSION,
default_str: Some("bg=themegreen,fg=themeblack"),
flags: OPTIONS_TABLE_IS_STYLE,
separator: c!(","),
text: c!("Style of the status line."),
..options_table_entry::const_default()
},
options_table_entry {
name: "update-environment",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SESSION,
flags: OPTIONS_TABLE_IS_ARRAY,
default_str: Some(
"DISPLAY KRB5CCNAME MSYSTEM SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID \
SSH_CONNECTION WAYLAND_DISPLAY WINDOWID XAUTHORITY XDG_CURRENT_DESKTOP \
XDG_SESSION_DESKTOP XDG_SESSION_TYPE",
),
text: c!(
"List of environment variables to update in the session environment when a client is attached."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "visual-activity",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_SESSION,
choices: &OPTIONS_TABLE_VISUAL_BELL_LIST,
default_num: visual_option::VISUAL_OFF as i64,
text: c!(
"How activity alerts should be shown: a message ('on'), a message and a bell ('both') or nothing ('off')."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "visual-bell",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_SESSION,
choices: &OPTIONS_TABLE_VISUAL_BELL_LIST,
default_num: visual_option::VISUAL_OFF as i64,
text: c!(
"How bell alerts should be shown: a message ('on'), a message and a bell ('both') or nothing ('off')."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "visual-silence",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_SESSION,
choices: &OPTIONS_TABLE_VISUAL_BELL_LIST,
default_num: visual_option::VISUAL_OFF as i64,
text: c!(
"How silence alerts should be shown: a message ('on'), a message and a bell ('both') or nothing ('off')."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "word-separators",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_SESSION,
default_str: Some("!\"#$%&'()*+,-./:;<=>?@[\\]^`{|}~"),
text: c!("Characters considered to separate words."),
..options_table_entry::const_default()
},
options_table_entry {
name: "aggressive-resize",
type_: options_table_type::OPTIONS_TABLE_FLAG,
scope: OPTIONS_TABLE_WINDOW,
default_num: 0,
text: c!(
"When 'window-size' is 'smallest', whether the maximum size of a window is the smallest attached session where it is the current window ('on') or the smallest session it is linked to ('off')."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "allow-passthrough",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_WINDOW | OPTIONS_TABLE_PANE,
choices: &OPTIONS_TABLE_ALLOW_PASSTHROUGH_LIST,
default_num: 0,
text: c!(
"Whether applications are allowed to use the escape sequence to bypass tmux. Can be 'off' (disallowed), 'on' (allowed if the pane is visible), or 'all' (allowed even if the pane is invisible)."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "allow-rename",
type_: options_table_type::OPTIONS_TABLE_FLAG,
scope: OPTIONS_TABLE_WINDOW | OPTIONS_TABLE_PANE,
default_num: 0,
text: c!("Whether applications are allowed to use the escape sequence to rename windows."),
..options_table_entry::const_default()
},
options_table_entry {
name: "allow-set-title",
type_: options_table_type::OPTIONS_TABLE_FLAG,
scope: OPTIONS_TABLE_WINDOW | OPTIONS_TABLE_PANE,
default_num: 1,
text: c!(
"Whether applications are allowed to use the escape sequence to set the pane title."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "alternate-screen",
type_: options_table_type::OPTIONS_TABLE_FLAG,
scope: OPTIONS_TABLE_WINDOW | OPTIONS_TABLE_PANE,
default_num: 1,
text: c!("Whether applications are allowed to use the alternate screen."),
..options_table_entry::const_default()
},
options_table_entry {
name: "automatic-rename",
type_: options_table_type::OPTIONS_TABLE_FLAG,
scope: OPTIONS_TABLE_WINDOW,
default_num: 1,
text: c!("Whether windows are automatically renamed."),
..options_table_entry::const_default()
},
options_table_entry {
name: "automatic-rename-format",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some("#{?pane_in_mode,[tmux],#{pane_current_command}}#{?pane_dead,[dead],}"),
text: c!("Format used to automatically rename windows."),
..options_table_entry::const_default()
},
options_table_entry {
name: "clock-mode-colour",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some("themeblue"),
flags: OPTIONS_TABLE_IS_COLOUR,
text: c!("Colour of the clock in clock mode."),
..options_table_entry::const_default()
},
options_table_entry {
name: "clock-mode-style",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_WINDOW,
choices: &OPTIONS_TABLE_CLOCK_MODE_STYLE_LIST,
default_num: 1,
text: c!("Time format of the clock in clock mode."),
..options_table_entry::const_default()
},
options_table_entry {
name: "copy-mode-match-style",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some("bg=themecyan,fg=themeblack"),
flags: OPTIONS_TABLE_IS_STYLE,
separator: c!(","),
text: c!("Style of search matches in copy mode."),
..options_table_entry::const_default()
},
options_table_entry {
name: "copy-mode-current-match-style",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some("bg=thememagenta,fg=themeblack"),
flags: OPTIONS_TABLE_IS_STYLE,
separator: c!(","),
text: c!("Style of the current search match in copy mode."),
..options_table_entry::const_default()
},
options_table_entry {
name: "copy-mode-mark-style",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some("bg=themeyellow,fg=themeblack"),
flags: OPTIONS_TABLE_IS_STYLE,
separator: c!(","),
text: c!("Style of the marked line in copy mode."),
..options_table_entry::const_default()
},
options_table_entry {
name: "fill-character",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some(""),
text: c!("Character used to fill unused parts of window."),
..options_table_entry::const_default()
},
options_table_entry {
name: "main-pane-height",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some("24"),
text: c!(
"Height of the main pane in the 'main-horizontal' layout. This may be a percentage, for example '10%'."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "main-pane-width",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some("80"),
text: c!(
"Width of the main pane in the 'main-vertical' layout. This may be a percentage, for example '10%'."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "mode-keys",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_WINDOW,
choices: &OPTIONS_TABLE_MODE_KEYS_LIST,
default_num: modekey::MODEKEY_EMACS as i64,
text: c!("Key set used in copy mode."),
..options_table_entry::const_default()
},
options_table_entry {
name: "mode-style",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
flags: OPTIONS_TABLE_IS_STYLE,
default_str: Some("noattr,bg=themeyellow,fg=themeblack"),
separator: c!(","),
text: c!("Style of indicators and highlighting in modes."),
..options_table_entry::const_default()
},
options_table_entry {
name: "monitor-activity",
type_: options_table_type::OPTIONS_TABLE_FLAG,
scope: OPTIONS_TABLE_WINDOW,
default_num: 0,
text: c!("Whether an alert is triggered by activity."),
..options_table_entry::const_default()
},
options_table_entry {
name: "monitor-bell",
type_: options_table_type::OPTIONS_TABLE_FLAG,
scope: OPTIONS_TABLE_WINDOW,
default_num: 1,
text: c!("Whether an alert is triggered by a bell."),
..options_table_entry::const_default()
},
options_table_entry {
name: "monitor-silence",
type_: options_table_type::OPTIONS_TABLE_NUMBER,
scope: OPTIONS_TABLE_WINDOW,
minimum: 0,
maximum: i32::MAX as u32,
default_num: 0,
text: c!("Time after which an alert is triggered by silence. Zero means no alert."),
..options_table_entry::const_default()
},
options_table_entry {
name: "other-pane-height",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some("0"),
text: c!(
"Height of the other panes in the 'main-horizontal' layout. This may be a percentage, for example '10%'."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "other-pane-width",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some("0"),
text: c!(
"Height of the other panes in the 'main-vertical' layout. This may be a percentage, for example '10%'."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "pane-active-border-style",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some("fg=#{?pane_marked,thememagenta,#{?synchronize-panes,themered,#{?pane_in_mode,themeyellow,themegreen}}}"),
flags: OPTIONS_TABLE_IS_STYLE,
separator: c!(","),
text: c!("Style of the active pane border."),
..options_table_entry::const_default()
},
options_table_entry {
name: "pane-base-index",
type_: options_table_type::OPTIONS_TABLE_NUMBER,
scope: OPTIONS_TABLE_WINDOW,
minimum: 0,
maximum: u16::MAX as u32,
default_num: 0,
text: c!("Index of the first pane in each window."),
..options_table_entry::const_default()
},
options_table_entry {
name: "pane-border-format",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW | OPTIONS_TABLE_PANE,
default_str: Some(
"#{?pane_active,#[reverse],}#{pane_index}#[default] \"#{pane_title}\"#{?#{mouse},#[align=right]#[range=control|8][#{?#{window_zoomed_flag},u,z}]#[norange]#[range=control|9][x]#[norange],}",
),
text: c!("Format of text in the pane status lines."),
..options_table_entry::const_default()
},
options_table_entry {
name: "pane-border-indicators",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_WINDOW,
choices: &OPTIONS_TABLE_PANE_BORDER_INDICATORS_LIST,
default_num: pane_border_indicator::PANE_BORDER_COLOUR as i64,
text: c!(
"Whether to indicate the active pane by colouring border or displaying arrow markers."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "pane-border-lines",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_WINDOW,
choices: &OPTIONS_TABLE_PANE_BORDER_LINES_LIST,
default_num: pane_lines::PANE_LINES_SINGLE as i64,
text: c!(
"Type of characters used to draw pane border lines. Some of these are only supported on terminals with UTF-8 support."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "pane-border-status",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_WINDOW | OPTIONS_TABLE_PANE,
choices: &OPTIONS_TABLE_PANE_STATUS_LIST,
default_num: pane_status::PANE_STATUS_OFF as i64,
text: c!("Position of the pane status lines."),
..options_table_entry::const_default()
},
options_table_entry {
name: "pane-status-style",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some("default"),
flags: OPTIONS_TABLE_IS_STYLE,
separator: c!(","),
text: c!("Style of panes in the status line, except the current pane."),
..options_table_entry::const_default()
},
options_table_entry {
name: "pane-status-current-style",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some("underscore"),
flags: OPTIONS_TABLE_IS_STYLE,
separator: c!(","),
text: c!("Style of the current pane in the status line."),
..options_table_entry::const_default()
},
options_table_entry {
name: "session-status-style",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some("default"),
flags: OPTIONS_TABLE_IS_STYLE,
separator: c!(","),
text: c!("Style of sessions in the status line, except the current session."),
..options_table_entry::const_default()
},
options_table_entry {
name: "session-status-current-style",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some("underscore"),
flags: OPTIONS_TABLE_IS_STYLE,
separator: c!(","),
text: c!("Style of the current session in the status line."),
..options_table_entry::const_default()
},
options_table_entry {
name: "window-pane-status-format",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some("#P:[#T]#{?pane_flags,#{pane_flags}, }"),
text: c!("Format of window panes in the status line, except the current pane."),
..options_table_entry::const_default()
},
options_table_entry {
name: "window-pane-current-status-format",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some("#P:[#T]#{?pane_flags,#{pane_flags}, }"),
text: c!("Format of the current window pane in the status line."),
..options_table_entry::const_default()
},
options_table_entry {
name: "pane-border-style",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some("fg=themelightgrey"),
flags: OPTIONS_TABLE_IS_STYLE,
separator: c!(","),
text: c!("Style of the pane status lines."),
..options_table_entry::const_default()
},
options_table_entry {
name: "pane-colours",
type_: options_table_type::OPTIONS_TABLE_COLOUR,
scope: OPTIONS_TABLE_WINDOW | OPTIONS_TABLE_PANE,
default_str: Some(""),
flags: OPTIONS_TABLE_IS_ARRAY,
text: c!("The default colour palette for colours zero to 255."),
..options_table_entry::const_default()
},
options_table_entry {
name: "popup-style",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some("bg=themedarkgrey,fg=themewhite"),
flags: OPTIONS_TABLE_IS_STYLE,
separator: c!(","),
text: c!("Default style of popups."),
..options_table_entry::const_default()
},
options_table_entry {
name: "popup-border-style",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some("bg=themedarkgrey,fg=themelightgrey"),
flags: OPTIONS_TABLE_IS_STYLE,
separator: c!(","),
text: c!("Default style of popup borders."),
..options_table_entry::const_default()
},
options_table_entry {
name: "popup-border-lines",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_WINDOW,
choices: &OPTIONS_TABLE_POPUP_BORDER_LINES_LIST,
default_num: box_lines::BOX_LINES_SINGLE as i64,
text: c!(
"Type of characters used to draw popup border lines. Some of these are only supported on terminals with UTF-8 support."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "remain-on-exit",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_WINDOW | OPTIONS_TABLE_PANE,
choices: &OPTIONS_TABLE_REMAIN_ON_EXIT_LIST,
default_num: 0,
text: c!(
"Whether panes should remain ('on') or be automatically killed ('off' or 'failed') when the program inside exits."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "remain-on-exit-format",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW | OPTIONS_TABLE_PANE,
default_str: Some(
"Pane is dead (#{?#{!=:#{pane_dead_status},},status #{pane_dead_status},}#{?#{!=:#{pane_dead_signal},},signal #{pane_dead_signal},}, #{t:pane_dead_time})",
),
text: c!(
"Message shown after the program in a pane has exited, if remain-on-exit is enabled."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "scroll-on-clear",
type_: options_table_type::OPTIONS_TABLE_FLAG,
scope: OPTIONS_TABLE_WINDOW | OPTIONS_TABLE_PANE,
default_num: 1,
text: c!(
"Whether the contents of the screen should be scrolled into history when clearing the whole screen."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "synchronize-panes",
type_: options_table_type::OPTIONS_TABLE_FLAG,
scope: OPTIONS_TABLE_WINDOW | OPTIONS_TABLE_PANE,
default_num: 0,
text: c!("Whether typing should be sent to all panes simultaneously."),
..options_table_entry::const_default()
},
options_table_entry {
name: "tiled-layout-max-columns",
type_: options_table_type::OPTIONS_TABLE_NUMBER,
scope: OPTIONS_TABLE_WINDOW,
minimum: 0,
maximum: u16::MAX as u32,
default_num: 0,
text: c!(
"Maximum number of columns in the 'tiled' layout. A value of 0 means no limit."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "window-active-style",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW | OPTIONS_TABLE_PANE,
default_str: Some("default"),
flags: OPTIONS_TABLE_IS_STYLE,
separator: c!(","),
text: c!("Default style of the active pane."),
..options_table_entry::const_default()
},
options_table_entry {
name: "window-size",
type_: options_table_type::OPTIONS_TABLE_CHOICE,
scope: OPTIONS_TABLE_WINDOW,
choices: &OPTIONS_TABLE_WINDOW_SIZE_LIST,
default_num: window_size_option::WINDOW_SIZE_LATEST as i64,
text: c!(
"How window size is calculated. 'latest' uses the size of the most recently used client, 'largest' the largest client, 'smallest' the smallest client and 'manual' a size set by the 'resize-window' command."
),
..options_table_entry::const_default()
},
options_table_entry {
name: "window-style",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW | OPTIONS_TABLE_PANE,
default_str: Some("default"),
flags: OPTIONS_TABLE_IS_STYLE,
separator: c!(","),
text: c!("Default style of panes that are not the active pane."),
..options_table_entry::const_default()
},
options_table_entry {
name: "window-status-activity-style",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some("reverse"),
flags: OPTIONS_TABLE_IS_STYLE,
separator: c!(","),
text: c!("Style of windows in the status line with an activity alert."),
..options_table_entry::const_default()
},
options_table_entry {
name: "window-status-bell-style",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some("reverse"),
flags: OPTIONS_TABLE_IS_STYLE,
separator: c!(","),
text: c!("Style of windows in the status line with a bell alert."),
..options_table_entry::const_default()
},
options_table_entry {
name: "window-status-current-format",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some("#I:#W#{?window_flags,#{window_flags}, }"),
text: c!("Format of the current window in the status line."),
..options_table_entry::const_default()
},
options_table_entry {
name: "window-status-current-style",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some("underscore"),
flags: OPTIONS_TABLE_IS_STYLE,
separator: c!(","),
text: c!("Style of the current window in the status line."),
..options_table_entry::const_default()
},
options_table_entry {
name: "window-status-format",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some("#I:#W#{?window_flags,#{window_flags}, }"),
text: c!("Format of windows in the status line, except the current window."),
..options_table_entry::const_default()
},
options_table_entry {
name: "window-status-last-style",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some("default"),
flags: OPTIONS_TABLE_IS_STYLE,
separator: c!(","),
text: c!("Style of the last window in the status line."),
..options_table_entry::const_default()
},
options_table_entry {
name: "window-status-separator",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some(" "),
text: c!("Separator between windows in the status line."),
..options_table_entry::const_default()
},
options_table_entry {
name: "window-status-style",
type_: options_table_type::OPTIONS_TABLE_STRING,
scope: OPTIONS_TABLE_WINDOW,
default_str: Some("default"),
flags: OPTIONS_TABLE_IS_STYLE,
separator: c!(","),
text: c!("Style of windows in the status line, except the current and last windows."),
..options_table_entry::const_default()
},
options_table_entry {
name: "wrap-search",
type_: options_table_type::OPTIONS_TABLE_FLAG,
scope: OPTIONS_TABLE_WINDOW,
default_num: 1,
text: c!("Whether searching in copy mode should wrap at the top or bottom."),
..options_table_entry::const_default()
},
options_table_entry {
name: "xterm-keys",
type_: options_table_type::OPTIONS_TABLE_FLAG,
scope: OPTIONS_TABLE_WINDOW,
default_num: 1,
text: c!(
"Whether xterm-style function key sequences should be sent. This option is no longer used."
),
..options_table_entry::const_default()
},
options_table_hook!("after-bind-key", ""),
options_table_hook!("after-capture-pane", ""),
options_table_hook!("after-copy-mode", ""),
options_table_hook!("after-display-message", ""),
options_table_hook!("after-display-panes", ""),
options_table_hook!("after-kill-pane", ""),
options_table_hook!("after-list-buffers", ""),
options_table_hook!("after-list-clients", ""),
options_table_hook!("after-list-keys", ""),
options_table_hook!("after-list-panes", ""),
options_table_hook!("after-list-sessions", ""),
options_table_hook!("after-list-windows", ""),
options_table_hook!("after-load-buffer", ""),
options_table_hook!("after-lock-server", ""),
options_table_hook!("after-new-session", ""),
options_table_hook!("after-new-window", ""),
options_table_hook!("after-paste-buffer", ""),
options_table_hook!("after-pipe-pane", ""),
options_table_hook!("after-queue", ""),
options_table_hook!("after-refresh-client", ""),
options_table_hook!("after-rename-session", ""),
options_table_hook!("after-rename-window", ""),
options_table_hook!("after-resize-pane", ""),
options_table_hook!("after-resize-window", ""),
options_table_hook!("after-save-buffer", ""),
options_table_hook!("after-select-layout", ""),
options_table_hook!("after-select-pane", ""),
options_table_hook!("after-select-window", ""),
options_table_hook!("after-send-keys", ""),
options_table_hook!("after-set-buffer", ""),
options_table_hook!("after-set-environment", ""),
options_table_hook!("after-set-hook", ""),
options_table_hook!("after-set-option", ""),
options_table_hook!("after-show-environment", ""),
options_table_hook!("after-show-messages", ""),
options_table_hook!("after-show-options", ""),
options_table_hook!("after-split-window", ""),
options_table_hook!("after-unbind-key", ""),
options_table_hook!("alert-activity", ""),
options_table_hook!("alert-bell", ""),
options_table_hook!("alert-silence", ""),
options_table_hook!("client-active", ""),
options_table_hook!("client-attached", ""),
options_table_hook!("client-detached", ""),
options_table_hook!("client-focus-in", ""),
options_table_hook!("client-focus-out", ""),
options_table_hook!("client-resized", ""),
options_table_hook!("client-session-changed", ""),
options_table_hook!("command-error", ""),
options_table_pane_hook!("pane-died", ""),
options_table_pane_hook!("pane-exited", ""),
options_table_pane_hook!("pane-fous-in", ""),
options_table_pane_hook!("pane-fous-out", ""),
options_table_pane_hook!("pane-mode-hanged", ""),
options_table_pane_hook!("pane-set-lipboard", ""),
options_table_pane_hook!("pane-title-hanged", ""),
options_table_hook!("session-closed", ""),
options_table_hook!("session-created", ""),
options_table_hook!("session-renamed", ""),
options_table_hook!("session-window-changed", ""),
options_table_window_hook!("window-layout-changed", ""),
options_table_hook!("window-linked", ""),
options_table_window_hook!("window-pane-changed", ""),
options_table_window_hook!("window-renamed", ""),
options_table_window_hook!("window-resized", ""),
options_table_hook!("window-unlinked", ""),
];
#[cfg(test)]
mod tests {
use super::*;
use std::collections::HashSet;
#[test]
fn test_options_table_names_unique_and_nonempty() {
let mut seen: HashSet<&str> = HashSet::new();
for oe in &OPTIONS_TABLE {
assert!(!oe.name.is_empty(), "OPTIONS_TABLE has an unnamed entry");
assert!(
seen.insert(oe.name),
"duplicate OPTIONS_TABLE name: {}",
oe.name
);
}
assert_eq!(seen.len(), OPTIONS_TABLE.len());
}
#[test]
fn test_options_table_choice_defaults_in_range() {
for oe in &OPTIONS_TABLE {
if oe.type_ == options_table_type::OPTIONS_TABLE_CHOICE {
assert!(
!oe.choices.is_empty(),
"CHOICE option {} has no choices",
oe.name
);
assert!(
oe.default_num >= 0 && (oe.default_num as usize) < oe.choices.len(),
"CHOICE option {} default_num {} out of range 0..{}",
oe.name,
oe.default_num,
oe.choices.len()
);
} else {
assert!(
oe.choices.is_empty(),
"non-CHOICE option {} unexpectedly has choices",
oe.name
);
}
}
}
#[test]
fn test_options_table_number_bounds() {
for oe in &OPTIONS_TABLE {
if oe.type_ == options_table_type::OPTIONS_TABLE_NUMBER {
assert!(
oe.minimum <= oe.maximum,
"NUMBER option {} has minimum {} > maximum {}",
oe.name,
oe.minimum,
oe.maximum
);
assert!(
oe.default_num >= oe.minimum as i64 && oe.default_num <= oe.maximum as i64,
"NUMBER option {} default_num {} outside [{}, {}]",
oe.name,
oe.default_num,
oe.minimum,
oe.maximum
);
}
}
}
fn table_get(name: &str) -> &'static options_table_entry {
OPTIONS_TABLE
.iter()
.find(|oe| oe.name == name)
.unwrap_or_else(|| panic!("no OPTIONS_TABLE entry named {name}"))
}
#[test]
fn test_entry_buffer_limit_matches_c() {
let oe = table_get("buffer-limit");
assert!(oe.type_ == options_table_type::OPTIONS_TABLE_NUMBER);
assert_eq!(oe.scope, OPTIONS_TABLE_SERVER);
assert_eq!(oe.minimum, 1);
assert_eq!(oe.maximum, i32::MAX as u32);
assert_eq!(oe.default_num, 50);
}
#[test]
fn test_entry_status_matches_c() {
let oe = table_get("status");
assert!(oe.type_ == options_table_type::OPTIONS_TABLE_CHOICE);
assert_eq!(oe.scope, OPTIONS_TABLE_SESSION);
assert_eq!(oe.default_num, 1);
assert_eq!(oe.choices[oe.default_num as usize], "on");
assert_eq!(oe.choices, &OPTIONS_TABLE_STATUS_LIST);
}
#[test]
fn test_entry_mode_and_status_keys() {
for name in ["mode-keys", "status-keys"] {
let oe = table_get(name);
assert!(oe.type_ == options_table_type::OPTIONS_TABLE_CHOICE);
assert_eq!(oe.default_num, modekey::MODEKEY_EMACS as i64);
assert_eq!(oe.choices, &["emacs", "vi"]);
assert_eq!(oe.choices[oe.default_num as usize], "emacs");
}
assert_eq!(table_get("mode-keys").scope, OPTIONS_TABLE_WINDOW);
assert_eq!(table_get("status-keys").scope, OPTIONS_TABLE_SESSION);
}
#[test]
fn test_pane_border_status_scope_window_and_pane() {
let oe = table_get("pane-border-status");
assert!(oe.type_ == options_table_type::OPTIONS_TABLE_CHOICE);
assert_eq!(oe.scope, OPTIONS_TABLE_WINDOW | OPTIONS_TABLE_PANE);
assert_ne!(oe.scope & OPTIONS_TABLE_PANE, 0);
assert_ne!(oe.scope & OPTIONS_TABLE_WINDOW, 0);
}
#[test]
fn test_style_entries_are_strings() {
for oe in &OPTIONS_TABLE {
if oe.flags & OPTIONS_TABLE_IS_STYLE != 0 {
assert!(
oe.type_ == options_table_type::OPTIONS_TABLE_STRING,
"IS_STYLE option {} is not a STRING",
oe.name
);
}
}
}
#[test]
fn test_hook_entries_are_command_arrays() {
let mut hooks = 0;
for oe in &OPTIONS_TABLE {
if oe.flags & OPTIONS_TABLE_IS_HOOK != 0 {
hooks += 1;
assert!(
oe.type_ == options_table_type::OPTIONS_TABLE_COMMAND,
"hook {} is not a COMMAND option",
oe.name
);
assert!(
oe.flags & OPTIONS_TABLE_IS_ARRAY != 0,
"hook {} is not an array",
oe.name
);
}
}
assert!(hooks > 0, "expected at least one IS_HOOK entry");
}
#[test]
fn test_unit_only_on_numbers() {
for oe in &OPTIONS_TABLE {
if !oe.unit.is_null() {
assert!(
oe.type_ == options_table_type::OPTIONS_TABLE_NUMBER,
"non-NUMBER option {} has a unit label",
oe.name
);
}
}
}
#[test]
fn test_other_names_targets_resolve() {
for m in &OPTIONS_OTHER_NAMES {
assert!(
OPTIONS_TABLE.iter().any(|oe| oe.name == m.to),
"alias target {} is not a real option",
m.to
);
assert!(
!OPTIONS_TABLE.iter().any(|oe| oe.name == m.from),
"alias source {} unexpectedly is a real option",
m.from
);
}
assert_eq!(OPTIONS_OTHER_NAMES.len(), OPTIONS_OTHER_NAMES_STR.len());
for (a, b) in OPTIONS_OTHER_NAMES.iter().zip(OPTIONS_OTHER_NAMES_STR.iter()) {
assert_eq!(a.from, b.from);
assert_eq!(a.to, b.to);
}
}
#[test]
fn test_scope_bits_are_valid() {
let mask = OPTIONS_TABLE_SERVER
| OPTIONS_TABLE_SESSION
| OPTIONS_TABLE_WINDOW
| OPTIONS_TABLE_PANE;
for oe in &OPTIONS_TABLE {
assert_eq!(
oe.scope & !mask,
0,
"option {} has scope bits outside the valid mask",
oe.name
);
}
}
#[test]
fn test_choice_lists_have_no_empty_or_dupes() {
for oe in &OPTIONS_TABLE {
if oe.type_ == options_table_type::OPTIONS_TABLE_CHOICE {
let mut seen: HashSet<&str> = HashSet::new();
for &c in oe.choices {
assert!(!c.is_empty(), "empty choice in {}", oe.name);
assert!(seen.insert(c), "duplicate choice {} in {}", c, oe.name);
}
}
}
}
#[test]
fn test_array_entry_types() {
for oe in &OPTIONS_TABLE {
if oe.flags & OPTIONS_TABLE_IS_ARRAY != 0 {
assert!(
matches!(
oe.type_,
options_table_type::OPTIONS_TABLE_STRING
| options_table_type::OPTIONS_TABLE_COMMAND
| options_table_type::OPTIONS_TABLE_COLOUR
),
"array option {} has an unexpected element type",
oe.name
);
}
}
}
}