xref: /openbsd/usr.bin/tmux/options-table.c (revision 3d40d63a)
1 /* $OpenBSD: options-table.c,v 1.188 2025/01/01 15:17:36 nicm Exp $ */
2 
3 /*
4  * Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com>
5  *
6  * Permission to use, copy, modify, and distribute this software for any
7  * purpose with or without fee is hereby granted, provided that the above
8  * copyright notice and this permission notice appear in all copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
15  * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
16  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 #include <sys/types.h>
20 
21 #include <string.h>
22 #include <paths.h>
23 
24 #include "tmux.h"
25 
26 /*
27  * This file has a tables with all the server, session and window
28  * options. These tables are the master copy of the options with their real
29  * (user-visible) types, range limits and default values. At start these are
30  * copied into the runtime global options trees (which only has number and
31  * string types). These tables are then used to look up the real type when the
32  * user sets an option or its value needs to be shown.
33  */
34 
35 /* Choice option type lists. */
36 static const char *options_table_mode_keys_list[] = {
37 	"emacs", "vi", NULL
38 };
39 static const char *options_table_clock_mode_style_list[] = {
40 	"12", "24", NULL
41 };
42 static const char *options_table_status_list[] = {
43 	"off", "on", "2", "3", "4", "5", NULL
44 };
45 static const char *options_table_message_line_list[] = {
46 	"0", "1", "2", "3", "4", NULL
47 };
48 static const char *options_table_status_keys_list[] = {
49 	"emacs", "vi", NULL
50 };
51 static const char *options_table_status_justify_list[] = {
52 	"left", "centre", "right", "absolute-centre", NULL
53 };
54 static const char *options_table_status_position_list[] = {
55 	"top", "bottom", NULL
56 };
57 static const char *options_table_bell_action_list[] = {
58 	"none", "any", "current", "other", NULL
59 };
60 static const char *options_table_visual_bell_list[] = {
61 	"off", "on", "both", NULL
62 };
63 static const char *options_table_cursor_style_list[] = {
64 	"default", "blinking-block", "block", "blinking-underline", "underline",
65 	"blinking-bar", "bar", NULL
66 };
67 static const char *options_table_pane_scrollbars_list[] = {
68 	"off", "modal", "on", NULL
69 };
70 static const char *options_table_pane_scrollbars_position_list[] = {
71 	"right", "left", NULL
72 };
73 static const char *options_table_pane_status_list[] = {
74 	"off", "top", "bottom", NULL
75 };
76 static const char *options_table_pane_border_indicators_list[] = {
77 	"off", "colour", "arrows", "both", NULL
78 };
79 static const char *options_table_pane_border_lines_list[] = {
80 	"single", "double", "heavy", "simple", "number", NULL
81 };
82 static const char *options_table_popup_border_lines_list[] = {
83 	"single", "double", "heavy", "simple", "rounded", "padded", "none", NULL
84 };
85 static const char *options_table_set_clipboard_list[] = {
86 	"off", "external", "on", NULL
87 };
88 static const char *options_table_window_size_list[] = {
89 	"largest", "smallest", "manual", "latest", NULL
90 };
91 static const char *options_table_remain_on_exit_list[] = {
92 	"off", "on", "failed", NULL
93 };
94 static const char *options_table_destroy_unattached_list[] = {
95 	"off", "on", "keep-last", "keep-group", NULL
96 };
97 static const char *options_table_detach_on_destroy_list[] = {
98 	"off", "on", "no-detached", "previous", "next", NULL
99 };
100 static const char *options_table_extended_keys_list[] = {
101 	"off", "on", "always", NULL
102 };
103 static const char *options_table_extended_keys_format_list[] = {
104 	"csi-u", "xterm", NULL
105 };
106 static const char *options_table_allow_passthrough_list[] = {
107 	"off", "on", "all", NULL
108 };
109 
110 /* Status line format. */
111 #define OPTIONS_TABLE_STATUS_FORMAT1 \
112 	"#[align=left range=left #{E:status-left-style}]" \
113 	"#[push-default]" \
114 	"#{T;=/#{status-left-length}:status-left}" \
115 	"#[pop-default]" \
116 	"#[norange default]" \
117 	"#[list=on align=#{status-justify}]" \
118 	"#[list=left-marker]<#[list=right-marker]>#[list=on]" \
119 	"#{W:" \
120 		"#[range=window|#{window_index} " \
121 			"#{E:window-status-style}" \
122 			"#{?#{&&:#{window_last_flag}," \
123 				"#{!=:#{E:window-status-last-style},default}}, " \
124 				"#{E:window-status-last-style}," \
125 			"}" \
126 			"#{?#{&&:#{window_bell_flag}," \
127 				"#{!=:#{E:window-status-bell-style},default}}, " \
128 				"#{E:window-status-bell-style}," \
129 				"#{?#{&&:#{||:#{window_activity_flag}," \
130 					     "#{window_silence_flag}}," \
131 					"#{!=:" \
132 					"#{E:window-status-activity-style}," \
133 					"default}}, " \
134 					"#{E:window-status-activity-style}," \
135 				"}" \
136 			"}" \
137 		"]" \
138 		"#[push-default]" \
139 		"#{T:window-status-format}" \
140 		"#[pop-default]" \
141 		"#[norange default]" \
142 		"#{?window_end_flag,,#{window-status-separator}}" \
143 	"," \
144 		"#[range=window|#{window_index} list=focus " \
145 			"#{?#{!=:#{E:window-status-current-style},default}," \
146 				"#{E:window-status-current-style}," \
147 				"#{E:window-status-style}" \
148 			"}" \
149 			"#{?#{&&:#{window_last_flag}," \
150 				"#{!=:#{E:window-status-last-style},default}}, " \
151 				"#{E:window-status-last-style}," \
152 			"}" \
153 			"#{?#{&&:#{window_bell_flag}," \
154 				"#{!=:#{E:window-status-bell-style},default}}, " \
155 				"#{E:window-status-bell-style}," \
156 				"#{?#{&&:#{||:#{window_activity_flag}," \
157 					     "#{window_silence_flag}}," \
158 					"#{!=:" \
159 					"#{E:window-status-activity-style}," \
160 					"default}}, " \
161 					"#{E:window-status-activity-style}," \
162 				"}" \
163 			"}" \
164 		"]" \
165 		"#[push-default]" \
166 		"#{T:window-status-current-format}" \
167 		"#[pop-default]" \
168 		"#[norange list=on default]" \
169 		"#{?window_end_flag,,#{window-status-separator}}" \
170 	"}" \
171 	"#[nolist align=right range=right #{E:status-right-style}]" \
172 	"#[push-default]" \
173 	"#{T;=/#{status-right-length}:status-right}" \
174 	"#[pop-default]" \
175 	"#[norange default]"
176 #define OPTIONS_TABLE_STATUS_FORMAT2 \
177 	"#[align=centre]#{P:#{?pane_active,#[reverse],}" \
178 	"#{pane_index}[#{pane_width}x#{pane_height}]#[default] }"
179 static const char *options_table_status_format_default[] = {
180 	OPTIONS_TABLE_STATUS_FORMAT1, OPTIONS_TABLE_STATUS_FORMAT2, NULL
181 };
182 
183 /* Helpers for hook options. */
184 #define OPTIONS_TABLE_HOOK(hook_name, default_value) \
185 	{ .name = hook_name, \
186 	  .type = OPTIONS_TABLE_COMMAND, \
187 	  .scope = OPTIONS_TABLE_SESSION, \
188 	  .flags = OPTIONS_TABLE_IS_ARRAY|OPTIONS_TABLE_IS_HOOK, \
189 	  .default_str = default_value,	\
190 	  .separator = "" \
191 	}
192 
193 #define OPTIONS_TABLE_PANE_HOOK(hook_name, default_value) \
194 	{ .name = hook_name, \
195 	  .type = OPTIONS_TABLE_COMMAND, \
196 	  .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE, \
197 	  .flags = OPTIONS_TABLE_IS_ARRAY|OPTIONS_TABLE_IS_HOOK, \
198 	  .default_str = default_value,	\
199 	  .separator = "" \
200 	}
201 
202 #define OPTIONS_TABLE_WINDOW_HOOK(hook_name, default_value) \
203 	{ .name = hook_name, \
204 	  .type = OPTIONS_TABLE_COMMAND, \
205 	  .scope = OPTIONS_TABLE_WINDOW, \
206 	  .flags = OPTIONS_TABLE_IS_ARRAY|OPTIONS_TABLE_IS_HOOK, \
207 	  .default_str = default_value,	\
208 	  .separator = "" \
209 	}
210 
211 /* Map of name conversions. */
212 const struct options_name_map options_other_names[] = {
213 	{ "display-panes-color", "display-panes-colour" },
214 	{ "display-panes-active-color", "display-panes-active-colour" },
215 	{ "clock-mode-color", "clock-mode-colour" },
216 	{ "cursor-color", "cursor-colour" },
217 	{ "prompt-cursor-color", "prompt-cursor-colour" },
218 	{ "pane-colors", "pane-colours" },
219 	{ NULL, NULL }
220 };
221 
222 /* Top-level options. */
223 const struct options_table_entry options_table[] = {
224 	/* Server options. */
225 	{ .name = "backspace",
226 	  .type = OPTIONS_TABLE_KEY,
227 	  .scope = OPTIONS_TABLE_SERVER,
228 	  .default_num = '\177',
229 	  .text = "The key to send for backspace."
230 	},
231 
232 	{ .name = "buffer-limit",
233 	  .type = OPTIONS_TABLE_NUMBER,
234 	  .scope = OPTIONS_TABLE_SERVER,
235 	  .minimum = 1,
236 	  .maximum = INT_MAX,
237 	  .default_num = 50,
238 	  .text = "The maximum number of automatic buffers. "
239 		  "When this is reached, the oldest buffer is deleted."
240 	},
241 
242 	{ .name = "command-alias",
243 	  .type = OPTIONS_TABLE_STRING,
244 	  .scope = OPTIONS_TABLE_SERVER,
245 	  .flags = OPTIONS_TABLE_IS_ARRAY,
246 	  .default_str = "split-pane=split-window,"
247 			 "splitp=split-window,"
248 			 "server-info=show-messages -JT,"
249 			 "info=show-messages -JT,"
250 			 "choose-window=choose-tree -w,"
251 			 "choose-session=choose-tree -s",
252 	  .separator = ",",
253 	  .text = "Array of command aliases. "
254 		  "Each entry is an alias and a command separated by '='."
255 	},
256 
257 	{ .name = "codepoint-widths",
258 	  .type = OPTIONS_TABLE_STRING,
259 	  .scope = OPTIONS_TABLE_SERVER,
260 	  .flags = OPTIONS_TABLE_IS_ARRAY,
261 	  .default_str = "",
262 	  .separator = ",",
263 	  .text = "Array of override widths for Unicode codepoints."
264 	},
265 
266 	{ .name = "copy-command",
267 	  .type = OPTIONS_TABLE_STRING,
268 	  .scope = OPTIONS_TABLE_SERVER,
269 	  .default_str = "",
270 	  .text = "Shell command run when text is copied. "
271 		  "If empty, no command is run."
272 	},
273 
274 	{ .name = "cursor-colour",
275 	  .type = OPTIONS_TABLE_COLOUR,
276 	  .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
277 	  .default_num = -1,
278 	  .text = "Colour of the cursor."
279 	},
280 
281 	{ .name = "cursor-style",
282 	  .type = OPTIONS_TABLE_CHOICE,
283 	  .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
284 	  .choices = options_table_cursor_style_list,
285 	  .default_num = 0,
286 	  .text = "Style of the cursor."
287 	},
288 
289 	{ .name = "default-terminal",
290 	  .type = OPTIONS_TABLE_STRING,
291 	  .scope = OPTIONS_TABLE_SERVER,
292 	  .default_str = TMUX_TERM,
293 	  .text = "Default for the 'TERM' environment variable."
294 	},
295 
296 	{ .name = "editor",
297 	  .type = OPTIONS_TABLE_STRING,
298 	  .scope = OPTIONS_TABLE_SERVER,
299 	  .default_str = _PATH_VI,
300 	  .text = "Editor run to edit files."
301 	},
302 
303 	{ .name = "escape-time",
304 	  .type = OPTIONS_TABLE_NUMBER,
305 	  .scope = OPTIONS_TABLE_SERVER,
306 	  .minimum = 0,
307 	  .maximum = INT_MAX,
308 	  .default_num = 10,
309 	  .unit = "milliseconds",
310 	  .text = "Time to wait before assuming a key is Escape."
311 	},
312 
313 	{ .name = "exit-empty",
314 	  .type = OPTIONS_TABLE_FLAG,
315 	  .scope = OPTIONS_TABLE_SERVER,
316 	  .default_num = 1,
317 	  .text = "Whether the server should exit if there are no sessions."
318 	},
319 
320 	{ .name = "exit-unattached",
321 	  .type = OPTIONS_TABLE_FLAG,
322 	  .scope = OPTIONS_TABLE_SERVER,
323 	  .default_num = 0,
324 	  .text = "Whether the server should exit if there are no attached "
325 		  "clients."
326 	},
327 
328 	{ .name = "extended-keys",
329 	  .type = OPTIONS_TABLE_CHOICE,
330 	  .scope = OPTIONS_TABLE_SERVER,
331 	  .choices = options_table_extended_keys_list,
332 	  .default_num = 0,
333 	  .text = "Whether to request extended key sequences from terminals "
334 		  "that support it."
335 	},
336 
337 	{ .name = "extended-keys-format",
338 	  .type = OPTIONS_TABLE_CHOICE,
339 	  .scope = OPTIONS_TABLE_SERVER,
340 	  .choices = options_table_extended_keys_format_list,
341 	  .default_num = 1,
342 	  .text = "The format of emitted extended key sequences."
343 	},
344 
345 	{ .name = "focus-events",
346 	  .type = OPTIONS_TABLE_FLAG,
347 	  .scope = OPTIONS_TABLE_SERVER,
348 	  .default_num = 0,
349 	  .text = "Whether to send focus events to applications."
350 	},
351 
352 	{ .name = "history-file",
353 	  .type = OPTIONS_TABLE_STRING,
354 	  .scope = OPTIONS_TABLE_SERVER,
355 	  .default_str = "",
356 	  .text = "Location of the command prompt history file. "
357 		  "Empty does not write a history file."
358 	},
359 
360 	{ .name = "input-buffer-size",
361 	  .type = OPTIONS_TABLE_NUMBER,
362 	  .scope = OPTIONS_TABLE_SERVER,
363 	  .minimum = INPUT_BUF_DEFAULT_SIZE,
364 	  .maximum = UINT_MAX,
365 	  .default_num = INPUT_BUF_DEFAULT_SIZE,
366 	  .text = "Number of byte accpted in a single input before dropping."
367 	},
368 
369 	{ .name = "menu-style",
370 	  .type = OPTIONS_TABLE_STRING,
371 	  .scope = OPTIONS_TABLE_WINDOW,
372 	  .flags = OPTIONS_TABLE_IS_STYLE,
373 	  .default_str = "default",
374 	  .separator = ",",
375 	  .text = "Default style of menu."
376 	},
377 
378 	{ .name = "menu-selected-style",
379 	  .type = OPTIONS_TABLE_STRING,
380 	  .scope = OPTIONS_TABLE_WINDOW,
381 	  .flags = OPTIONS_TABLE_IS_STYLE,
382 	  .default_str = "bg=yellow,fg=black",
383 	  .separator = ",",
384 	  .text = "Default style of selected menu item."
385 	},
386 
387 	{ .name = "menu-border-style",
388 	  .type = OPTIONS_TABLE_STRING,
389 	  .scope = OPTIONS_TABLE_WINDOW,
390 	  .default_str = "default",
391 	  .flags = OPTIONS_TABLE_IS_STYLE,
392 	  .separator = ",",
393 	  .text = "Default style of menu borders."
394 	},
395 
396 	{ .name = "menu-border-lines",
397 	  .type = OPTIONS_TABLE_CHOICE,
398 	  .scope = OPTIONS_TABLE_WINDOW,
399 	  .choices = options_table_popup_border_lines_list,
400 	  .default_num = BOX_LINES_SINGLE,
401 	  .text = "Type of characters used to draw menu border lines. Some of "
402 	          "these are only supported on terminals with UTF-8 support."
403 	},
404 
405 	{ .name = "message-limit",
406 	  .type = OPTIONS_TABLE_NUMBER,
407 	  .scope = OPTIONS_TABLE_SERVER,
408 	  .minimum = 0,
409 	  .maximum = INT_MAX,
410 	  .default_num = 1000,
411 	  .text = "Maximum number of server messages to keep."
412 	},
413 
414 	{ .name = "prefix-timeout",
415 	  .type = OPTIONS_TABLE_NUMBER,
416 	  .scope = OPTIONS_TABLE_SERVER,
417 	  .minimum = 0,
418 	  .maximum = INT_MAX,
419 	  .default_num = 0,
420 	  .unit = "milliseconds",
421 	  .text = "The timeout for the prefix key if no subsequent key is "
422 	          "pressed. Zero means disabled."
423 	},
424 
425 	{ .name = "prompt-history-limit",
426 	  .type = OPTIONS_TABLE_NUMBER,
427 	  .scope = OPTIONS_TABLE_SERVER,
428 	  .minimum = 0,
429 	  .maximum = INT_MAX,
430 	  .default_num = 100,
431 	  .text = "Maximum number of commands to keep in history."
432 	},
433 
434 	{ .name = "set-clipboard",
435 	  .type = OPTIONS_TABLE_CHOICE,
436 	  .scope = OPTIONS_TABLE_SERVER,
437 	  .choices = options_table_set_clipboard_list,
438 	  .default_num = 1,
439 	  .text = "Whether to attempt to set the system clipboard ('on' or "
440 		  "'external') and whether to allow applications to create "
441 		  "paste buffers with an escape sequence ('on' only)."
442 	},
443 
444 	{ .name = "terminal-overrides",
445 	  .type = OPTIONS_TABLE_STRING,
446 	  .scope = OPTIONS_TABLE_SERVER,
447 	  .flags = OPTIONS_TABLE_IS_ARRAY,
448 	  .default_str = "linux*:AX@",
449 	  .separator = ",",
450 	  .text = "List of terminal capabilities overrides."
451 	},
452 
453 	{ .name = "terminal-features",
454 	  .type = OPTIONS_TABLE_STRING,
455 	  .scope = OPTIONS_TABLE_SERVER,
456 	  .flags = OPTIONS_TABLE_IS_ARRAY,
457 	  .default_str = "xterm*:clipboard:ccolour:cstyle:focus:title,"
458 			 "screen*:title,"
459 	                 "rxvt*:ignorefkeys",
460 	  .separator = ",",
461 	  .text = "List of terminal features, used if they cannot be "
462 		  "automatically detected."
463 	},
464 
465 	{ .name = "user-keys",
466 	  .type = OPTIONS_TABLE_STRING,
467 	  .scope = OPTIONS_TABLE_SERVER,
468 	  .flags = OPTIONS_TABLE_IS_ARRAY,
469 	  .default_str = "",
470 	  .separator = ",",
471 	  .text = "User key assignments. "
472 		  "Each sequence in the list is translated into a key: "
473 		  "'User0', 'User1' and so on."
474 	},
475 
476 	/* Session options. */
477 	{ .name = "activity-action",
478 	  .type = OPTIONS_TABLE_CHOICE,
479 	  .scope = OPTIONS_TABLE_SESSION,
480 	  .choices = options_table_bell_action_list,
481 	  .default_num = ALERT_OTHER,
482 	  .text = "Action to take on an activity alert."
483 	},
484 
485 	{ .name = "assume-paste-time",
486 	  .type = OPTIONS_TABLE_NUMBER,
487 	  .scope = OPTIONS_TABLE_SESSION,
488 	  .minimum = 0,
489 	  .maximum = INT_MAX,
490 	  .default_num = 1,
491 	  .unit = "milliseconds",
492 	  .text = "Maximum time between input to assume it is pasting rather "
493 		  "than typing."
494 	},
495 
496 	{ .name = "base-index",
497 	  .type = OPTIONS_TABLE_NUMBER,
498 	  .scope = OPTIONS_TABLE_SESSION,
499 	  .minimum = 0,
500 	  .maximum = INT_MAX,
501 	  .default_num = 0,
502 	  .text = "Default index of the first window in each session."
503 	},
504 
505 	{ .name = "bell-action",
506 	  .type = OPTIONS_TABLE_CHOICE,
507 	  .scope = OPTIONS_TABLE_SESSION,
508 	  .choices = options_table_bell_action_list,
509 	  .default_num = ALERT_ANY,
510 	  .text = "Action to take on a bell alert."
511 	},
512 
513 	{ .name = "default-command",
514 	  .type = OPTIONS_TABLE_STRING,
515 	  .scope = OPTIONS_TABLE_SESSION,
516 	  .default_str = "",
517 	  .text = "Default command to run in new panes. If empty, a shell is "
518 		  "started."
519 	},
520 
521 	{ .name = "default-shell",
522 	  .type = OPTIONS_TABLE_STRING,
523 	  .scope = OPTIONS_TABLE_SESSION,
524 	  .default_str = _PATH_BSHELL,
525 	  .text = "Location of default shell."
526 	},
527 
528 	{ .name = "default-size",
529 	  .type = OPTIONS_TABLE_STRING,
530 	  .scope = OPTIONS_TABLE_SESSION,
531 	  .pattern = "[0-9]*x[0-9]*",
532 	  .default_str = "80x24",
533 	  .text = "Initial size of new sessions."
534 	},
535 
536 	{ .name = "destroy-unattached",
537 	  .type = OPTIONS_TABLE_CHOICE,
538 	  .scope = OPTIONS_TABLE_SESSION,
539 	  .choices = options_table_destroy_unattached_list,
540 	  .default_num = 0,
541 	  .text = "Whether to destroy sessions when they have no attached "
542 		  "clients, or keep the last session whether in the group."
543 	},
544 
545 	{ .name = "detach-on-destroy",
546 	  .type = OPTIONS_TABLE_CHOICE,
547 	  .scope = OPTIONS_TABLE_SESSION,
548 	  .choices = options_table_detach_on_destroy_list,
549 	  .default_num = 1,
550 	  .text = "Whether to detach when a session is destroyed, or switch "
551 		  "the client to another session if any exist."
552 	},
553 
554 	{ .name = "display-panes-active-colour",
555 	  .type = OPTIONS_TABLE_COLOUR,
556 	  .scope = OPTIONS_TABLE_SESSION,
557 	  .default_num = 1,
558 	  .text = "Colour of the active pane for 'display-panes'."
559 	},
560 
561 	{ .name = "display-panes-colour",
562 	  .type = OPTIONS_TABLE_COLOUR,
563 	  .scope = OPTIONS_TABLE_SESSION,
564 	  .default_num = 4,
565 	  .text = "Colour of not active panes for 'display-panes'."
566 	},
567 
568 	{ .name = "display-panes-time",
569 	  .type = OPTIONS_TABLE_NUMBER,
570 	  .scope = OPTIONS_TABLE_SESSION,
571 	  .minimum = 1,
572 	  .maximum = INT_MAX,
573 	  .default_num = 1000,
574 	  .unit = "milliseconds",
575 	  .text = "Time for which 'display-panes' should show pane numbers."
576 	},
577 
578 	{ .name = "display-time",
579 	  .type = OPTIONS_TABLE_NUMBER,
580 	  .scope = OPTIONS_TABLE_SESSION,
581 	  .minimum = 0,
582 	  .maximum = INT_MAX,
583 	  .default_num = 750,
584 	  .unit = "milliseconds",
585 	  .text = "Time for which status line messages should appear."
586 	},
587 
588 	{ .name = "history-limit",
589 	  .type = OPTIONS_TABLE_NUMBER,
590 	  .scope = OPTIONS_TABLE_SESSION,
591 	  .minimum = 0,
592 	  .maximum = INT_MAX,
593 	  .default_num = 2000,
594 	  .unit = "lines",
595 	  .text = "Maximum number of lines to keep in the history for each "
596 		  "pane. "
597 		  "If changed, the new value applies only to new panes."
598 	},
599 
600 	{ .name = "initial-repeat-time",
601 	  .type = OPTIONS_TABLE_NUMBER,
602 	  .scope = OPTIONS_TABLE_SESSION,
603 	  .minimum = 0,
604 	  .maximum = 2000000,
605 	  .default_num = 0,
606 	  .unit = "milliseconds",
607 	  .text = "Time to wait for a key binding to repeat the first time the "
608 	          "key is pressed, if it is bound with the '-r' flag. "
609 	          "Subsequent presses use the 'repeat-time' option."
610 	},
611 
612 	{ .name = "key-table",
613 	  .type = OPTIONS_TABLE_STRING,
614 	  .scope = OPTIONS_TABLE_SESSION,
615 	  .default_str = "root",
616 	  .text = "Default key table. "
617 		  "Key presses are first looked up in this table."
618 	},
619 
620 	{ .name = "lock-after-time",
621 	  .type = OPTIONS_TABLE_NUMBER,
622 	  .scope = OPTIONS_TABLE_SESSION,
623 	  .minimum = 0,
624 	  .maximum = INT_MAX,
625 	  .default_num = 0,
626 	  .unit = "seconds",
627 	  .text = "Time after which a client is locked if not used."
628 	},
629 
630 	{ .name = "lock-command",
631 	  .type = OPTIONS_TABLE_STRING,
632 	  .scope = OPTIONS_TABLE_SESSION,
633 	  .default_str = "lock -np",
634 	  .text = "Shell command to run to lock a client."
635 	},
636 
637 	{ .name = "message-command-style",
638 	  .type = OPTIONS_TABLE_STRING,
639 	  .scope = OPTIONS_TABLE_SESSION,
640 	  .default_str = "bg=black,fg=yellow",
641 	  .flags = OPTIONS_TABLE_IS_STYLE,
642 	  .separator = ",",
643 	  .text = "Style of the command prompt when in command mode, if "
644 		  "'mode-keys' is set to 'vi'."
645 	},
646 
647 	{ .name = "message-line",
648 	  .type = OPTIONS_TABLE_CHOICE,
649 	  .scope = OPTIONS_TABLE_SESSION,
650 	  .choices = options_table_message_line_list,
651 	  .default_num = 0,
652 	  .text = "Position (line) of messages and the command prompt."
653 	},
654 
655 	{ .name = "message-style",
656 	  .type = OPTIONS_TABLE_STRING,
657 	  .scope = OPTIONS_TABLE_SESSION,
658 	  .default_str = "bg=yellow,fg=black",
659 	  .flags = OPTIONS_TABLE_IS_STYLE,
660 	  .separator = ",",
661 	  .text = "Style of messages and the command prompt."
662 	},
663 
664 	{ .name = "mouse",
665 	  .type = OPTIONS_TABLE_FLAG,
666 	  .scope = OPTIONS_TABLE_SESSION,
667 	  .default_num = 0,
668 	  .text = "Whether the mouse is recognised and mouse key bindings are "
669 		  "executed. "
670 		  "Applications inside panes can use the mouse even when 'off'."
671 	},
672 
673 	{ .name = "prefix",
674 	  .type = OPTIONS_TABLE_KEY,
675 	  .scope = OPTIONS_TABLE_SESSION,
676 	  .default_num = 'b'|KEYC_CTRL,
677 	  .text = "The prefix key."
678 	},
679 
680 	{ .name = "prefix2",
681 	  .type = OPTIONS_TABLE_KEY,
682 	  .scope = OPTIONS_TABLE_SESSION,
683 	  .default_num = KEYC_NONE,
684 	  .text = "A second prefix key."
685 	},
686 
687 	{ .name = "renumber-windows",
688 	  .type = OPTIONS_TABLE_FLAG,
689 	  .scope = OPTIONS_TABLE_SESSION,
690 	  .default_num = 0,
691 	  .text = "Whether windows are automatically renumbered rather than "
692 		  "leaving gaps."
693 	},
694 
695 	{ .name = "repeat-time",
696 	  .type = OPTIONS_TABLE_NUMBER,
697 	  .scope = OPTIONS_TABLE_SESSION,
698 	  .minimum = 0,
699 	  .maximum = 2000000,
700 	  .default_num = 500,
701 	  .unit = "milliseconds",
702 	  .text = "Time to wait for a key binding to repeat, if it is bound "
703 		  "with the '-r' flag."
704 	},
705 
706 	{ .name = "set-titles",
707 	  .type = OPTIONS_TABLE_FLAG,
708 	  .scope = OPTIONS_TABLE_SESSION,
709 	  .default_num = 0,
710 	  .text = "Whether to set the terminal title, if supported."
711 	},
712 
713 	{ .name = "set-titles-string",
714 	  .type = OPTIONS_TABLE_STRING,
715 	  .scope = OPTIONS_TABLE_SESSION,
716 	  .default_str = "#S:#I:#W - \"#T\" #{session_alerts}",
717 	  .text = "Format of the terminal title to set."
718 	},
719 
720 	{ .name = "silence-action",
721 	  .type = OPTIONS_TABLE_CHOICE,
722 	  .scope = OPTIONS_TABLE_SESSION,
723 	  .choices = options_table_bell_action_list,
724 	  .default_num = ALERT_OTHER,
725 	  .text = "Action to take on a silence alert."
726 	},
727 
728 	{ .name = "status",
729 	  .type = OPTIONS_TABLE_CHOICE,
730 	  .scope = OPTIONS_TABLE_SESSION,
731 	  .choices = options_table_status_list,
732 	  .default_num = 1,
733 	  .text = "Number of lines in the status line."
734 	},
735 
736 	{ .name = "status-bg",
737 	  .type = OPTIONS_TABLE_COLOUR,
738 	  .scope = OPTIONS_TABLE_SESSION,
739 	  .default_num = 8,
740 	  .text = "Background colour of the status line. This option is "
741 		  "deprecated, use 'status-style' instead."
742 	},
743 
744 	{ .name = "status-fg",
745 	  .type = OPTIONS_TABLE_COLOUR,
746 	  .scope = OPTIONS_TABLE_SESSION,
747 	  .default_num = 8,
748 	  .text = "Foreground colour of the status line. This option is "
749 		  "deprecated, use 'status-style' instead."
750 	},
751 
752 	{ .name = "status-format",
753 	  .type = OPTIONS_TABLE_STRING,
754 	  .scope = OPTIONS_TABLE_SESSION,
755 	  .flags = OPTIONS_TABLE_IS_ARRAY,
756 	  .default_arr = options_table_status_format_default,
757 	  .text = "Formats for the status lines. "
758 		  "Each array member is the format for one status line. "
759 		  "The default status line is made up of several components "
760 		  "which may be configured individually with other options such "
761 		  "as 'status-left'."
762 	},
763 
764 	{ .name = "status-interval",
765 	  .type = OPTIONS_TABLE_NUMBER,
766 	  .scope = OPTIONS_TABLE_SESSION,
767 	  .minimum = 0,
768 	  .maximum = INT_MAX,
769 	  .default_num = 15,
770 	  .unit = "seconds",
771 	  .text = "Number of seconds between status line updates."
772 	},
773 
774 	{ .name = "status-justify",
775 	  .type = OPTIONS_TABLE_CHOICE,
776 	  .scope = OPTIONS_TABLE_SESSION,
777 	  .choices = options_table_status_justify_list,
778 	  .default_num = 0,
779 	  .text = "Position of the window list in the status line."
780 	},
781 
782 	{ .name = "status-keys",
783 	  .type = OPTIONS_TABLE_CHOICE,
784 	  .scope = OPTIONS_TABLE_SESSION,
785 	  .choices = options_table_status_keys_list,
786 	  .default_num = MODEKEY_EMACS,
787 	  .text = "Key set to use at the command prompt."
788 	},
789 
790 	{ .name = "status-left",
791 	  .type = OPTIONS_TABLE_STRING,
792 	  .scope = OPTIONS_TABLE_SESSION,
793 	  .default_str = "[#{session_name}] ",
794 	  .text = "Contents of the left side of the status line."
795 	},
796 
797 	{ .name = "status-left-length",
798 	  .type = OPTIONS_TABLE_NUMBER,
799 	  .scope = OPTIONS_TABLE_SESSION,
800 	  .minimum = 0,
801 	  .maximum = SHRT_MAX,
802 	  .default_num = 10,
803 	  .text = "Maximum width of the left side of the status line."
804 	},
805 
806 	{ .name = "status-left-style",
807 	  .type = OPTIONS_TABLE_STRING,
808 	  .scope = OPTIONS_TABLE_SESSION,
809 	  .default_str = "default",
810 	  .flags = OPTIONS_TABLE_IS_STYLE,
811 	  .separator = ",",
812 	  .text = "Style of the left side of the status line."
813 	},
814 
815 	{ .name = "status-position",
816 	  .type = OPTIONS_TABLE_CHOICE,
817 	  .scope = OPTIONS_TABLE_SESSION,
818 	  .choices = options_table_status_position_list,
819 	  .default_num = 1,
820 	  .text = "Position of the status line."
821 	},
822 
823 	{ .name = "status-right",
824 	  .type = OPTIONS_TABLE_STRING,
825 	  .scope = OPTIONS_TABLE_SESSION,
826 	  .default_str = "#{?window_bigger,"
827 			 "[#{window_offset_x}#,#{window_offset_y}] ,}"
828 			 "\"#{=21:pane_title}\" %H:%M %d-%b-%y",
829 	  .text = "Contents of the right side of the status line."
830 
831 	},
832 
833 	{ .name = "status-right-length",
834 	  .type = OPTIONS_TABLE_NUMBER,
835 	  .scope = OPTIONS_TABLE_SESSION,
836 	  .minimum = 0,
837 	  .maximum = SHRT_MAX,
838 	  .default_num = 40,
839 	  .text = "Maximum width of the right side of the status line."
840 	},
841 
842 	{ .name = "status-right-style",
843 	  .type = OPTIONS_TABLE_STRING,
844 	  .scope = OPTIONS_TABLE_SESSION,
845 	  .default_str = "default",
846 	  .flags = OPTIONS_TABLE_IS_STYLE,
847 	  .separator = ",",
848 	  .text = "Style of the right side of the status line."
849 	},
850 
851 	{ .name = "status-style",
852 	  .type = OPTIONS_TABLE_STRING,
853 	  .scope = OPTIONS_TABLE_SESSION,
854 	  .default_str = "bg=green,fg=black",
855 	  .flags = OPTIONS_TABLE_IS_STYLE,
856 	  .separator = ",",
857 	  .text = "Style of the status line."
858 	},
859 
860 	{ .name = "prompt-cursor-colour",
861 	  .type = OPTIONS_TABLE_COLOUR,
862 	  .scope = OPTIONS_TABLE_SESSION,
863 	  .default_num = 6,
864 	  .text = "Colour of the cursor when in the command prompt."
865 	},
866 
867 	{ .name = "prompt-cursor-style",
868 	  .type = OPTIONS_TABLE_CHOICE,
869 	  .scope = OPTIONS_TABLE_SESSION,
870 	  .choices = options_table_cursor_style_list,
871 	  .default_num = 0,
872 	  .text = "Style of the cursor when in the command prompt."
873 	},
874 
875 	{ .name = "update-environment",
876 	  .type = OPTIONS_TABLE_STRING,
877 	  .scope = OPTIONS_TABLE_SESSION,
878 	  .flags = OPTIONS_TABLE_IS_ARRAY,
879 	  .default_str = "DISPLAY KRB5CCNAME MSYSTEM SSH_ASKPASS SSH_AUTH_SOCK "
880 			 "SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY",
881 	  .text = "List of environment variables to update in the session "
882 		  "environment when a client is attached."
883 	},
884 
885 	{ .name = "visual-activity",
886 	  .type = OPTIONS_TABLE_CHOICE,
887 	  .scope = OPTIONS_TABLE_SESSION,
888 	  .choices = options_table_visual_bell_list,
889 	  .default_num = VISUAL_OFF,
890 	  .text = "How activity alerts should be shown: a message ('on'), "
891 		  "a message and a bell ('both') or nothing ('off')."
892 	},
893 
894 	{ .name = "visual-bell",
895 	  .type = OPTIONS_TABLE_CHOICE,
896 	  .scope = OPTIONS_TABLE_SESSION,
897 	  .choices = options_table_visual_bell_list,
898 	  .default_num = VISUAL_OFF,
899 	  .text = "How bell alerts should be shown: a message ('on'), "
900 		  "a message and a bell ('both') or nothing ('off')."
901 	},
902 
903 	{ .name = "visual-silence",
904 	  .type = OPTIONS_TABLE_CHOICE,
905 	  .scope = OPTIONS_TABLE_SESSION,
906 	  .choices = options_table_visual_bell_list,
907 	  .default_num = VISUAL_OFF,
908 	  .text = "How silence alerts should be shown: a message ('on'), "
909 		  "a message and a bell ('both') or nothing ('off')."
910 	},
911 
912 	{ .name = "word-separators",
913 	  .type = OPTIONS_TABLE_STRING,
914 	  .scope = OPTIONS_TABLE_SESSION,
915 	  /*
916 	   * The set of non-alphanumeric printable ASCII characters minus the
917 	   * underscore.
918 	   */
919 	  .default_str = "!\"#$%&'()*+,-./:;<=>?@[\\]^`{|}~",
920 	  .text = "Characters considered to separate words."
921 	},
922 
923 	/* Window options. */
924 	{ .name = "aggressive-resize",
925 	  .type = OPTIONS_TABLE_FLAG,
926 	  .scope = OPTIONS_TABLE_WINDOW,
927 	  .default_num = 0,
928 	  .text = "When 'window-size' is 'smallest', whether the maximum size "
929 		  "of a window is the smallest attached session where it is "
930 		  "the current window ('on') or the smallest session it is "
931 		  "linked to ('off')."
932 	},
933 
934 	{ .name = "allow-passthrough",
935 	  .type = OPTIONS_TABLE_CHOICE,
936 	  .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
937 	  .choices = options_table_allow_passthrough_list,
938 	  .default_num = 0,
939 	  .text = "Whether applications are allowed to use the escape sequence "
940 		  "to bypass tmux. Can be 'off' (disallowed), 'on' (allowed "
941 		  "if the pane is visible), or 'all' (allowed even if the pane "
942 		  "is invisible)."
943 	},
944 
945 	{ .name = "allow-rename",
946 	  .type = OPTIONS_TABLE_FLAG,
947 	  .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
948 	  .default_num = 0,
949 	  .text = "Whether applications are allowed to use the escape sequence "
950 		  "to rename windows."
951 	},
952 
953 	{ .name = "allow-set-title",
954 	  .type = OPTIONS_TABLE_FLAG,
955 	  .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
956 	  .default_num = 1,
957 	  .text = "Whether applications are allowed to use the escape sequence "
958 		  "to set the pane title."
959 	},
960 
961 	{ .name = "alternate-screen",
962 	  .type = OPTIONS_TABLE_FLAG,
963 	  .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
964 	  .default_num = 1,
965 	  .text = "Whether applications are allowed to use the alternate "
966 		  "screen."
967 	},
968 
969 	{ .name = "automatic-rename",
970 	  .type = OPTIONS_TABLE_FLAG,
971 	  .scope = OPTIONS_TABLE_WINDOW,
972 	  .default_num = 1,
973 	  .text = "Whether windows are automatically renamed."
974 	},
975 
976 	{ .name = "automatic-rename-format",
977 	  .type = OPTIONS_TABLE_STRING,
978 	  .scope = OPTIONS_TABLE_WINDOW,
979 	  .default_str = "#{?pane_in_mode,[tmux],#{pane_current_command}}"
980 			 "#{?pane_dead,[dead],}",
981 	  .text = "Format used to automatically rename windows."
982 	},
983 
984 	{ .name = "clock-mode-colour",
985 	  .type = OPTIONS_TABLE_COLOUR,
986 	  .scope = OPTIONS_TABLE_WINDOW,
987 	  .default_num = 4,
988 	  .text = "Colour of the clock in clock mode."
989 	},
990 
991 	{ .name = "clock-mode-style",
992 	  .type = OPTIONS_TABLE_CHOICE,
993 	  .scope = OPTIONS_TABLE_WINDOW,
994 	  .choices = options_table_clock_mode_style_list,
995 	  .default_num = 1,
996 	  .text = "Time format of the clock in clock mode."
997 	},
998 
999 	{ .name = "copy-mode-match-style",
1000 	  .type = OPTIONS_TABLE_STRING,
1001 	  .scope = OPTIONS_TABLE_WINDOW,
1002 	  .default_str = "bg=cyan,fg=black",
1003 	  .flags = OPTIONS_TABLE_IS_STYLE,
1004 	  .separator = ",",
1005 	  .text = "Style of search matches in copy mode."
1006 	},
1007 
1008 	{ .name = "copy-mode-current-match-style",
1009 	  .type = OPTIONS_TABLE_STRING,
1010 	  .scope = OPTIONS_TABLE_WINDOW,
1011 	  .default_str = "bg=magenta,fg=black",
1012 	  .flags = OPTIONS_TABLE_IS_STYLE,
1013 	  .separator = ",",
1014 	  .text = "Style of the current search match in copy mode."
1015 	},
1016 
1017 	{ .name = "copy-mode-mark-style",
1018 	  .type = OPTIONS_TABLE_STRING,
1019 	  .scope = OPTIONS_TABLE_WINDOW,
1020 	  .default_str = "bg=red,fg=black",
1021 	  .flags = OPTIONS_TABLE_IS_STYLE,
1022 	  .separator = ",",
1023 	  .text = "Style of the marked line in copy mode."
1024 	},
1025 
1026 	{ .name = "copy-mode-position-format",
1027 	  .type = OPTIONS_TABLE_STRING,
1028 	  .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
1029 	  .default_str = "#[align=right]"
1030 	                 "#{t/p:top_line_time}#{?#{e|>:#{top_line_time},0}, ,}"
1031 	                 "[#{scroll_position}/#{history_size}]"
1032 	                 "#{?search_timed_out, (timed out),"
1033 	                 "#{?search_count, (#{search_count}"
1034 	                 "#{?search_count_partial,+,} results),}}",
1035 	  .text = "Format of the position indicator in copy mode."
1036 	},
1037 
1038 	{ .name = "copy-mode-position-style",
1039 	  .type = OPTIONS_TABLE_STRING,
1040 	  .scope = OPTIONS_TABLE_WINDOW,
1041 	  .default_str = "#{mode-style}",
1042 	  .flags = OPTIONS_TABLE_IS_STYLE,
1043 	  .separator = ",",
1044 	  .text = "Style of position indicator in copy mode."
1045 	},
1046 
1047 	{ .name = "copy-mode-selection-style",
1048 	  .type = OPTIONS_TABLE_STRING,
1049 	  .scope = OPTIONS_TABLE_WINDOW,
1050 	  .default_str = "#{mode-style}",
1051 	  .flags = OPTIONS_TABLE_IS_STYLE,
1052 	  .separator = ",",
1053 	  .text = "Style of selection in copy mode."
1054 	},
1055 
1056 	{ .name = "fill-character",
1057 	  .type = OPTIONS_TABLE_STRING,
1058 	  .scope = OPTIONS_TABLE_WINDOW,
1059 	  .default_str = "",
1060 	  .text = "Character used to fill unused parts of window."
1061 	},
1062 
1063 	{ .name = "main-pane-height",
1064 	  .type = OPTIONS_TABLE_STRING,
1065 	  .scope = OPTIONS_TABLE_WINDOW,
1066 	  .default_str = "24",
1067 	  .text = "Height of the main pane in the 'main-horizontal' layout. "
1068 		  "This may be a percentage, for example '10%'."
1069 	},
1070 
1071 	{ .name = "main-pane-width",
1072 	  .type = OPTIONS_TABLE_STRING,
1073 	  .scope = OPTIONS_TABLE_WINDOW,
1074 	  .default_str = "80",
1075 	  .text = "Width of the main pane in the 'main-vertical' layout. "
1076 		  "This may be a percentage, for example '10%'."
1077 	},
1078 
1079 	{ .name = "mode-keys",
1080 	  .type = OPTIONS_TABLE_CHOICE,
1081 	  .scope = OPTIONS_TABLE_WINDOW,
1082 	  .choices = options_table_mode_keys_list,
1083 	  .default_num = MODEKEY_EMACS,
1084 	  .text = "Key set used in copy mode."
1085 	},
1086 
1087 	{ .name = "mode-style",
1088 	  .type = OPTIONS_TABLE_STRING,
1089 	  .scope = OPTIONS_TABLE_WINDOW,
1090 	  .flags = OPTIONS_TABLE_IS_STYLE,
1091 	  .default_str = "bg=yellow,fg=black",
1092 	  .separator = ",",
1093 	  .text = "Style of indicators and highlighting in modes."
1094 	},
1095 
1096 	{ .name = "monitor-activity",
1097 	  .type = OPTIONS_TABLE_FLAG,
1098 	  .scope = OPTIONS_TABLE_WINDOW,
1099 	  .default_num = 0,
1100 	  .text = "Whether an alert is triggered by activity."
1101 	},
1102 
1103 	{ .name = "monitor-bell",
1104 	  .type = OPTIONS_TABLE_FLAG,
1105 	  .scope = OPTIONS_TABLE_WINDOW,
1106 	  .default_num = 1,
1107 	  .text = "Whether an alert is triggered by a bell."
1108 	},
1109 
1110 	{ .name = "monitor-silence",
1111 	  .type = OPTIONS_TABLE_NUMBER,
1112 	  .scope = OPTIONS_TABLE_WINDOW,
1113 	  .minimum = 0,
1114 	  .maximum = INT_MAX,
1115 	  .default_num = 0,
1116 	  .text = "Time after which an alert is triggered by silence. "
1117 		  "Zero means no alert."
1118 
1119 	},
1120 
1121 	{ .name = "other-pane-height",
1122 	  .type = OPTIONS_TABLE_STRING,
1123 	  .scope = OPTIONS_TABLE_WINDOW,
1124 	  .default_str = "0",
1125 	  .text = "Height of the other panes in the 'main-horizontal' layout. "
1126 		  "This may be a percentage, for example '10%'."
1127 	},
1128 
1129 	{ .name = "other-pane-width",
1130 	  .type = OPTIONS_TABLE_STRING,
1131 	  .scope = OPTIONS_TABLE_WINDOW,
1132 	  .default_str = "0",
1133 	  .text = "Height of the other panes in the 'main-vertical' layout. "
1134 		  "This may be a percentage, for example '10%'."
1135 	},
1136 
1137 	{ .name = "pane-active-border-style",
1138 	  .type = OPTIONS_TABLE_STRING,
1139 	  .scope = OPTIONS_TABLE_WINDOW,
1140 	  .default_str = "#{?pane_in_mode,fg=yellow,#{?synchronize-panes,fg=red,fg=green}}",
1141 	  .flags = OPTIONS_TABLE_IS_STYLE,
1142 	  .separator = ",",
1143 	  .text = "Style of the active pane border."
1144 	},
1145 
1146 	{ .name = "pane-base-index",
1147 	  .type = OPTIONS_TABLE_NUMBER,
1148 	  .scope = OPTIONS_TABLE_WINDOW,
1149 	  .minimum = 0,
1150 	  .maximum = USHRT_MAX,
1151 	  .default_num = 0,
1152 	  .text = "Index of the first pane in each window."
1153 	},
1154 
1155 	{ .name = "pane-border-format",
1156 	  .type = OPTIONS_TABLE_STRING,
1157 	  .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
1158 	  .default_str = "#{?pane_active,#[reverse],}#{pane_index}#[default] "
1159 			 "\"#{pane_title}\"",
1160 	  .text = "Format of text in the pane status lines."
1161 	},
1162 
1163 	{ .name = "pane-border-indicators",
1164 	  .type = OPTIONS_TABLE_CHOICE,
1165 	  .scope = OPTIONS_TABLE_WINDOW,
1166 	  .choices = options_table_pane_border_indicators_list,
1167 	  .default_num = PANE_BORDER_COLOUR,
1168 	  .text = "Whether to indicate the active pane by colouring border or "
1169 		  "displaying arrow markers."
1170 	},
1171 
1172 	{ .name = "pane-border-lines",
1173 	  .type = OPTIONS_TABLE_CHOICE,
1174 	  .scope = OPTIONS_TABLE_WINDOW,
1175 	  .choices = options_table_pane_border_lines_list,
1176 	  .default_num = PANE_LINES_SINGLE,
1177 	  .text = "Type of characters used to draw pane border lines. Some of "
1178 		  "these are only supported on terminals with UTF-8 support."
1179 	},
1180 
1181 	{ .name = "pane-border-status",
1182 	  .type = OPTIONS_TABLE_CHOICE,
1183 	  .scope = OPTIONS_TABLE_WINDOW,
1184 	  .choices = options_table_pane_status_list,
1185 	  .default_num = PANE_STATUS_OFF,
1186 	  .text = "Position of the pane status lines."
1187 	},
1188 
1189 	{ .name = "pane-border-style",
1190 	  .type = OPTIONS_TABLE_STRING,
1191 	  .scope = OPTIONS_TABLE_WINDOW,
1192 	  .default_str = "default",
1193 	  .flags = OPTIONS_TABLE_IS_STYLE,
1194 	  .separator = ",",
1195 	  .text = "Style of the pane status lines."
1196 	},
1197 
1198 	{ .name = "pane-colours",
1199 	  .type = OPTIONS_TABLE_COLOUR,
1200 	  .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
1201 	  .default_str = "",
1202 	  .flags = OPTIONS_TABLE_IS_ARRAY,
1203 	  .text = "The default colour palette for colours zero to 255."
1204 	},
1205 
1206 	{ .name = "pane-scrollbars",
1207 	  .type = OPTIONS_TABLE_CHOICE,
1208 	  .scope = OPTIONS_TABLE_WINDOW,
1209 	  .choices = options_table_pane_scrollbars_list,
1210 	  .default_num = PANE_SCROLLBARS_OFF,
1211 	  .text = "Pane scrollbar state."
1212 	},
1213 
1214 	{ .name = "pane-scrollbars-style",
1215 	  .type = OPTIONS_TABLE_STRING,
1216 	  .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
1217 	  .default_str = "bg=black,fg=white,width=1,pad=0",
1218 	  .flags = OPTIONS_TABLE_IS_STYLE,
1219 	  .separator = ",",
1220 	  .text = "Style of the pane scrollbar."
1221 	},
1222 
1223 	{ .name = "pane-scrollbars-position",
1224 	  .type = OPTIONS_TABLE_CHOICE,
1225 	  .scope = OPTIONS_TABLE_WINDOW,
1226 	  .choices = options_table_pane_scrollbars_position_list,
1227 	  .default_num = PANE_SCROLLBARS_RIGHT,
1228 	  .text = "Pane scrollbar position."
1229 	},
1230 
1231         { .name = "popup-style",
1232 	  .type = OPTIONS_TABLE_STRING,
1233 	  .scope = OPTIONS_TABLE_WINDOW,
1234 	  .default_str = "default",
1235 	  .flags = OPTIONS_TABLE_IS_STYLE,
1236 	  .separator = ",",
1237 	  .text = "Default style of popups."
1238 	},
1239 
1240 	{ .name = "popup-border-style",
1241 	  .type = OPTIONS_TABLE_STRING,
1242 	  .scope = OPTIONS_TABLE_WINDOW,
1243 	  .default_str = "default",
1244 	  .flags = OPTIONS_TABLE_IS_STYLE,
1245 	  .separator = ",",
1246 	  .text = "Default style of popup borders."
1247 	},
1248 
1249 	{ .name = "popup-border-lines",
1250 	  .type = OPTIONS_TABLE_CHOICE,
1251 	  .scope = OPTIONS_TABLE_WINDOW,
1252 	  .choices = options_table_popup_border_lines_list,
1253 	  .default_num = BOX_LINES_SINGLE,
1254 	  .text = "Type of characters used to draw popup border lines. Some of "
1255 		  "these are only supported on terminals with UTF-8 support."
1256 	},
1257 
1258 	{ .name = "remain-on-exit",
1259 	  .type = OPTIONS_TABLE_CHOICE,
1260 	  .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
1261 	  .choices = options_table_remain_on_exit_list,
1262 	  .default_num = 0,
1263 	  .text = "Whether panes should remain ('on') or be automatically "
1264 		  "killed ('off' or 'failed') when the program inside exits."
1265 	},
1266 
1267 	{ .name = "remain-on-exit-format",
1268 	  .type = OPTIONS_TABLE_STRING,
1269 	  .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
1270 	  .default_str = "Pane is dead ("
1271 			 "#{?#{!=:#{pane_dead_status},},"
1272 	                 "status #{pane_dead_status},}"
1273 			 "#{?#{!=:#{pane_dead_signal},},"
1274 	                 "signal #{pane_dead_signal},}, "
1275 			 "#{t:pane_dead_time})",
1276 	  .text = "Message shown after the program in a pane has exited, if "
1277 	          "remain-on-exit is enabled."
1278 	},
1279 
1280 	{ .name = "scroll-on-clear",
1281 	  .type = OPTIONS_TABLE_FLAG,
1282 	  .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
1283 	  .default_num = 1,
1284 	  .text = "Whether the contents of the screen should be scrolled into"
1285 		  "history when clearing the whole screen."
1286 	},
1287 
1288 	{ .name = "synchronize-panes",
1289 	  .type = OPTIONS_TABLE_FLAG,
1290 	  .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
1291 	  .default_num = 0,
1292 	  .text = "Whether typing should be sent to all panes simultaneously."
1293 	},
1294 
1295 	{ .name = "window-active-style",
1296 	  .type = OPTIONS_TABLE_STRING,
1297 	  .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
1298 	  .default_str = "default",
1299 	  .flags = OPTIONS_TABLE_IS_STYLE,
1300 	  .separator = ",",
1301 	  .text = "Default style of the active pane."
1302 	},
1303 
1304 	{ .name = "window-size",
1305 	  .type = OPTIONS_TABLE_CHOICE,
1306 	  .scope = OPTIONS_TABLE_WINDOW,
1307 	  .choices = options_table_window_size_list,
1308 	  .default_num = WINDOW_SIZE_LATEST,
1309 	  .text = "How window size is calculated. "
1310 		  "'latest' uses the size of the most recently used client, "
1311 		  "'largest' the largest client, 'smallest' the smallest "
1312 		  "client and 'manual' a size set by the 'resize-window' "
1313 		  "command."
1314 	},
1315 
1316 	{ .name = "window-style",
1317 	  .type = OPTIONS_TABLE_STRING,
1318 	  .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
1319 	  .default_str = "default",
1320 	  .flags = OPTIONS_TABLE_IS_STYLE,
1321 	  .separator = ",",
1322 	  .text = "Default style of panes that are not the active pane."
1323 	},
1324 
1325 	{ .name = "window-status-activity-style",
1326 	  .type = OPTIONS_TABLE_STRING,
1327 	  .scope = OPTIONS_TABLE_WINDOW,
1328 	  .default_str = "reverse",
1329 	  .flags = OPTIONS_TABLE_IS_STYLE,
1330 	  .separator = ",",
1331 	  .text = "Style of windows in the status line with an activity alert."
1332 	},
1333 
1334 	{ .name = "window-status-bell-style",
1335 	  .type = OPTIONS_TABLE_STRING,
1336 	  .scope = OPTIONS_TABLE_WINDOW,
1337 	  .default_str = "reverse",
1338 	  .flags = OPTIONS_TABLE_IS_STYLE,
1339 	  .separator = ",",
1340 	  .text = "Style of windows in the status line with a bell alert."
1341 	},
1342 
1343 	{ .name = "window-status-current-format",
1344 	  .type = OPTIONS_TABLE_STRING,
1345 	  .scope = OPTIONS_TABLE_WINDOW,
1346 	  .default_str = "#I:#W#{?window_flags,#{window_flags}, }",
1347 	  .text = "Format of the current window in the status line."
1348 	},
1349 
1350 	{ .name = "window-status-current-style",
1351 	  .type = OPTIONS_TABLE_STRING,
1352 	  .scope = OPTIONS_TABLE_WINDOW,
1353 	  .default_str = "default",
1354 	  .flags = OPTIONS_TABLE_IS_STYLE,
1355 	  .separator = ",",
1356 	  .text = "Style of the current window in the status line."
1357 	},
1358 
1359 	{ .name = "window-status-format",
1360 	  .type = OPTIONS_TABLE_STRING,
1361 	  .scope = OPTIONS_TABLE_WINDOW,
1362 	  .default_str = "#I:#W#{?window_flags,#{window_flags}, }",
1363 	  .text = "Format of windows in the status line, except the current "
1364 		  "window."
1365 	},
1366 
1367 	{ .name = "window-status-last-style",
1368 	  .type = OPTIONS_TABLE_STRING,
1369 	  .scope = OPTIONS_TABLE_WINDOW,
1370 	  .default_str = "default",
1371 	  .flags = OPTIONS_TABLE_IS_STYLE,
1372 	  .separator = ",",
1373 	  .text = "Style of the last window in the status line."
1374 	},
1375 
1376 	{ .name = "window-status-separator",
1377 	  .type = OPTIONS_TABLE_STRING,
1378 	  .scope = OPTIONS_TABLE_WINDOW,
1379 	  .default_str = " ",
1380 	  .text = "Separator between windows in the status line."
1381 	},
1382 
1383 	{ .name = "window-status-style",
1384 	  .type = OPTIONS_TABLE_STRING,
1385 	  .scope = OPTIONS_TABLE_WINDOW,
1386 	  .default_str = "default",
1387 	  .flags = OPTIONS_TABLE_IS_STYLE,
1388 	  .separator = ",",
1389 	  .text = "Style of windows in the status line, except the current and "
1390 		  "last windows."
1391 	},
1392 
1393 	{ .name = "wrap-search",
1394 	  .type = OPTIONS_TABLE_FLAG,
1395 	  .scope = OPTIONS_TABLE_WINDOW,
1396 	  .default_num = 1,
1397 	  .text = "Whether searching in copy mode should wrap at the top or "
1398 		  "bottom."
1399 	},
1400 
1401 	{ .name = "xterm-keys", /* no longer used */
1402 	  .type = OPTIONS_TABLE_FLAG,
1403 	  .scope = OPTIONS_TABLE_WINDOW,
1404 	  .default_num = 1,
1405 	  .text = "Whether xterm-style function key sequences should be sent. "
1406 		  "This option is no longer used."
1407 	},
1408 
1409 	/* Hook options. */
1410 	OPTIONS_TABLE_HOOK("after-bind-key", ""),
1411 	OPTIONS_TABLE_HOOK("after-capture-pane", ""),
1412 	OPTIONS_TABLE_HOOK("after-copy-mode", ""),
1413 	OPTIONS_TABLE_HOOK("after-display-message", ""),
1414 	OPTIONS_TABLE_HOOK("after-display-panes", ""),
1415 	OPTIONS_TABLE_HOOK("after-kill-pane", ""),
1416 	OPTIONS_TABLE_HOOK("after-list-buffers", ""),
1417 	OPTIONS_TABLE_HOOK("after-list-clients", ""),
1418 	OPTIONS_TABLE_HOOK("after-list-keys", ""),
1419 	OPTIONS_TABLE_HOOK("after-list-panes", ""),
1420 	OPTIONS_TABLE_HOOK("after-list-sessions", ""),
1421 	OPTIONS_TABLE_HOOK("after-list-windows", ""),
1422 	OPTIONS_TABLE_HOOK("after-load-buffer", ""),
1423 	OPTIONS_TABLE_HOOK("after-lock-server", ""),
1424 	OPTIONS_TABLE_HOOK("after-new-session", ""),
1425 	OPTIONS_TABLE_HOOK("after-new-window", ""),
1426 	OPTIONS_TABLE_HOOK("after-paste-buffer", ""),
1427 	OPTIONS_TABLE_HOOK("after-pipe-pane", ""),
1428 	OPTIONS_TABLE_HOOK("after-queue", ""),
1429 	OPTIONS_TABLE_HOOK("after-refresh-client", ""),
1430 	OPTIONS_TABLE_HOOK("after-rename-session", ""),
1431 	OPTIONS_TABLE_HOOK("after-rename-window", ""),
1432 	OPTIONS_TABLE_HOOK("after-resize-pane", ""),
1433 	OPTIONS_TABLE_HOOK("after-resize-window", ""),
1434 	OPTIONS_TABLE_HOOK("after-save-buffer", ""),
1435 	OPTIONS_TABLE_HOOK("after-select-layout", ""),
1436 	OPTIONS_TABLE_HOOK("after-select-pane", ""),
1437 	OPTIONS_TABLE_HOOK("after-select-window", ""),
1438 	OPTIONS_TABLE_HOOK("after-send-keys", ""),
1439 	OPTIONS_TABLE_HOOK("after-set-buffer", ""),
1440 	OPTIONS_TABLE_HOOK("after-set-environment", ""),
1441 	OPTIONS_TABLE_HOOK("after-set-hook", ""),
1442 	OPTIONS_TABLE_HOOK("after-set-option", ""),
1443 	OPTIONS_TABLE_HOOK("after-show-environment", ""),
1444 	OPTIONS_TABLE_HOOK("after-show-messages", ""),
1445 	OPTIONS_TABLE_HOOK("after-show-options", ""),
1446 	OPTIONS_TABLE_HOOK("after-split-window", ""),
1447 	OPTIONS_TABLE_HOOK("after-unbind-key", ""),
1448 	OPTIONS_TABLE_HOOK("alert-activity", ""),
1449 	OPTIONS_TABLE_HOOK("alert-bell", ""),
1450 	OPTIONS_TABLE_HOOK("alert-silence", ""),
1451 	OPTIONS_TABLE_HOOK("client-active", ""),
1452 	OPTIONS_TABLE_HOOK("client-attached", ""),
1453 	OPTIONS_TABLE_HOOK("client-detached", ""),
1454 	OPTIONS_TABLE_HOOK("client-focus-in", ""),
1455 	OPTIONS_TABLE_HOOK("client-focus-out", ""),
1456 	OPTIONS_TABLE_HOOK("client-resized", ""),
1457 	OPTIONS_TABLE_HOOK("client-session-changed", ""),
1458 	OPTIONS_TABLE_HOOK("command-error", ""),
1459 	OPTIONS_TABLE_PANE_HOOK("pane-died", ""),
1460 	OPTIONS_TABLE_PANE_HOOK("pane-exited", ""),
1461 	OPTIONS_TABLE_PANE_HOOK("pane-focus-in", ""),
1462 	OPTIONS_TABLE_PANE_HOOK("pane-focus-out", ""),
1463 	OPTIONS_TABLE_PANE_HOOK("pane-mode-changed", ""),
1464 	OPTIONS_TABLE_PANE_HOOK("pane-set-clipboard", ""),
1465 	OPTIONS_TABLE_PANE_HOOK("pane-title-changed", ""),
1466 	OPTIONS_TABLE_HOOK("session-closed", ""),
1467 	OPTIONS_TABLE_HOOK("session-created", ""),
1468 	OPTIONS_TABLE_HOOK("session-renamed", ""),
1469 	OPTIONS_TABLE_HOOK("session-window-changed", ""),
1470 	OPTIONS_TABLE_WINDOW_HOOK("window-layout-changed", ""),
1471 	OPTIONS_TABLE_HOOK("window-linked", ""),
1472 	OPTIONS_TABLE_WINDOW_HOOK("window-pane-changed", ""),
1473 	OPTIONS_TABLE_WINDOW_HOOK("window-renamed", ""),
1474 	OPTIONS_TABLE_WINDOW_HOOK("window-resized", ""),
1475 	OPTIONS_TABLE_HOOK("window-unlinked", ""),
1476 
1477 	{ .name = NULL }
1478 };
1479