options-table.c revision 1.123
1/* $OpenBSD: options-table.c,v 1.123 2020/05/16 15:01:31 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. */
36static const char *options_table_mode_keys_list[] = {
37	"emacs", "vi", NULL
38};
39static const char *options_table_clock_mode_style_list[] = {
40	"12", "24", NULL
41};
42static const char *options_table_status_list[] = {
43	"off", "on", "2", "3", "4", "5", NULL
44};
45static const char *options_table_status_keys_list[] = {
46	"emacs", "vi", NULL
47};
48static const char *options_table_status_justify_list[] = {
49	"left", "centre", "right", NULL
50};
51static const char *options_table_status_position_list[] = {
52	"top", "bottom", NULL
53};
54static const char *options_table_bell_action_list[] = {
55	"none", "any", "current", "other", NULL
56};
57static const char *options_table_visual_bell_list[] = {
58	"off", "on", "both", NULL
59};
60static const char *options_table_pane_status_list[] = {
61	"off", "top", "bottom", NULL
62};
63static const char *options_table_set_clipboard_list[] = {
64	"off", "external", "on", NULL
65};
66static const char *options_table_window_size_list[] = {
67	"largest", "smallest", "manual", "latest", NULL
68};
69
70/* Status line format. */
71#define OPTIONS_TABLE_STATUS_FORMAT1 \
72	"#[align=left range=left #{status-left-style}]" \
73	"#[push-default]" \
74	"#{T;=/#{status-left-length}:status-left}" \
75	"#[pop-default]" \
76	"#[norange default]" \
77	"#[list=on align=#{status-justify}]" \
78	"#[list=left-marker]<#[list=right-marker]>#[list=on]" \
79	"#{W:" \
80		"#[range=window|#{window_index} " \
81			"#{window-status-style}" \
82			"#{?#{&&:#{window_last_flag}," \
83				"#{!=:#{window-status-last-style},default}}, " \
84				"#{window-status-last-style}," \
85			"}" \
86			"#{?#{&&:#{window_bell_flag}," \
87				"#{!=:#{window-status-bell-style},default}}, " \
88				"#{window-status-bell-style}," \
89				"#{?#{&&:#{||:#{window_activity_flag}," \
90					     "#{window_silence_flag}}," \
91					"#{!=:" \
92					"#{window-status-activity-style}," \
93					"default}}, " \
94					"#{window-status-activity-style}," \
95				"}" \
96			"}" \
97		"]" \
98		"#[push-default]" \
99		"#{T:window-status-format}" \
100		"#[pop-default]" \
101		"#[norange default]" \
102		"#{?window_end_flag,,#{window-status-separator}}" \
103	"," \
104		"#[range=window|#{window_index} list=focus " \
105			"#{?#{!=:#{window-status-current-style},default}," \
106	                        "#{window-status-current-style}," \
107	                        "#{window-status-style}" \
108	                "}" \
109			"#{?#{&&:#{window_last_flag}," \
110				"#{!=:#{window-status-last-style},default}}, " \
111				"#{window-status-last-style}," \
112			"}" \
113			"#{?#{&&:#{window_bell_flag}," \
114				"#{!=:#{window-status-bell-style},default}}, " \
115				"#{window-status-bell-style}," \
116				"#{?#{&&:#{||:#{window_activity_flag}," \
117					     "#{window_silence_flag}}," \
118					"#{!=:" \
119					"#{window-status-activity-style}," \
120					"default}}, " \
121					"#{window-status-activity-style}," \
122				"}" \
123			"}" \
124		"]" \
125		"#[push-default]" \
126		"#{T:window-status-current-format}" \
127		"#[pop-default]" \
128		"#[norange list=on default]" \
129		"#{?window_end_flag,,#{window-status-separator}}" \
130	"}" \
131	"#[nolist align=right range=right #{status-right-style}]" \
132	"#[push-default]" \
133	"#{T;=/#{status-right-length}:status-right}" \
134	"#[pop-default]" \
135	"#[norange default]"
136#define OPTIONS_TABLE_STATUS_FORMAT2 \
137	"#[align=centre]#{P:#{?pane_active,#[reverse],}" \
138	"#{pane_index}[#{pane_width}x#{pane_height}]#[default] }"
139static const char *options_table_status_format_default[] = {
140	OPTIONS_TABLE_STATUS_FORMAT1, OPTIONS_TABLE_STATUS_FORMAT2, NULL
141};
142
143/* Helpers for hook options. */
144#define OPTIONS_TABLE_HOOK(hook_name, default_value) \
145	{ .name = hook_name, \
146	  .type = OPTIONS_TABLE_COMMAND, \
147	  .scope = OPTIONS_TABLE_SESSION, \
148	  .flags = OPTIONS_TABLE_IS_ARRAY|OPTIONS_TABLE_IS_HOOK, \
149	  .default_str = default_value,	\
150	  .separator = "" \
151	}
152
153#define OPTIONS_TABLE_PANE_HOOK(hook_name, default_value) \
154	{ .name = hook_name, \
155	  .type = OPTIONS_TABLE_COMMAND, \
156	  .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE, \
157	  .flags = OPTIONS_TABLE_IS_ARRAY|OPTIONS_TABLE_IS_HOOK, \
158	  .default_str = default_value,	\
159	  .separator = "" \
160	}
161
162#define OPTIONS_TABLE_WINDOW_HOOK(hook_name, default_value) \
163	{ .name = hook_name, \
164	  .type = OPTIONS_TABLE_COMMAND, \
165	  .scope = OPTIONS_TABLE_WINDOW, \
166	  .flags = OPTIONS_TABLE_IS_ARRAY|OPTIONS_TABLE_IS_HOOK, \
167	  .default_str = default_value,	\
168	  .separator = "" \
169	}
170
171/* Top-level options. */
172const struct options_table_entry options_table[] = {
173	/* Server options. */
174	{ .name = "backspace",
175	  .type = OPTIONS_TABLE_KEY,
176	  .scope = OPTIONS_TABLE_SERVER,
177	  .default_num = '\177',
178	},
179
180	{ .name = "buffer-limit",
181	  .type = OPTIONS_TABLE_NUMBER,
182	  .scope = OPTIONS_TABLE_SERVER,
183	  .minimum = 1,
184	  .maximum = INT_MAX,
185	  .default_num = 50
186	},
187
188	{ .name = "command-alias",
189	  .type = OPTIONS_TABLE_STRING,
190	  .scope = OPTIONS_TABLE_SERVER,
191	  .flags = OPTIONS_TABLE_IS_ARRAY,
192	  .default_str = "split-pane=split-window,"
193			 "splitp=split-window,"
194			 "server-info=show-messages -JT,"
195			 "info=show-messages -JT,"
196			 "choose-window=choose-tree -w,"
197			 "choose-session=choose-tree -s",
198	  .separator = ","
199	},
200
201	{ .name = "copy-command",
202	  .type = OPTIONS_TABLE_STRING,
203	  .scope = OPTIONS_TABLE_SERVER,
204	  .default_str = ""
205	},
206
207	{ .name = "default-terminal",
208	  .type = OPTIONS_TABLE_STRING,
209	  .scope = OPTIONS_TABLE_SERVER,
210	  .default_str = "screen"
211	},
212
213	{ .name = "escape-time",
214	  .type = OPTIONS_TABLE_NUMBER,
215	  .scope = OPTIONS_TABLE_SERVER,
216	  .minimum = 0,
217	  .maximum = INT_MAX,
218	  .default_num = 500
219	},
220
221	{ .name = "exit-empty",
222	  .type = OPTIONS_TABLE_FLAG,
223	  .scope = OPTIONS_TABLE_SERVER,
224	  .default_num = 1
225	},
226
227	{ .name = "exit-unattached",
228	  .type = OPTIONS_TABLE_FLAG,
229	  .scope = OPTIONS_TABLE_SERVER,
230	  .default_num = 0
231	},
232
233	{ .name = "focus-events",
234	  .type = OPTIONS_TABLE_FLAG,
235	  .scope = OPTIONS_TABLE_SERVER,
236	  .default_num = 0
237	},
238
239	{ .name = "history-file",
240	  .type = OPTIONS_TABLE_STRING,
241	  .scope = OPTIONS_TABLE_SERVER,
242	  .default_str = ""
243	},
244
245	{ .name = "message-limit",
246	  .type = OPTIONS_TABLE_NUMBER,
247	  .scope = OPTIONS_TABLE_SERVER,
248	  .minimum = 0,
249	  .maximum = INT_MAX,
250	  .default_num = 100
251	},
252
253	{ .name = "set-clipboard",
254	  .type = OPTIONS_TABLE_CHOICE,
255	  .scope = OPTIONS_TABLE_SERVER,
256	  .choices = options_table_set_clipboard_list,
257	  .default_num = 1
258	},
259
260	{ .name = "terminal-overrides",
261	  .type = OPTIONS_TABLE_STRING,
262	  .scope = OPTIONS_TABLE_SERVER,
263	  .flags = OPTIONS_TABLE_IS_ARRAY,
264	  .default_str = "",
265	  .separator = ","
266	},
267
268	{ .name = "terminal-features",
269	  .type = OPTIONS_TABLE_STRING,
270	  .scope = OPTIONS_TABLE_SERVER,
271	  .flags = OPTIONS_TABLE_IS_ARRAY,
272	  .default_str = "xterm*:clipboard:ccolour:cstyle:title,"
273	                 "screen*:title",
274	  .separator = ","
275	},
276
277	{ .name = "user-keys",
278	  .type = OPTIONS_TABLE_STRING,
279	  .scope = OPTIONS_TABLE_SERVER,
280	  .flags = OPTIONS_TABLE_IS_ARRAY,
281	  .default_str = "",
282	  .separator = ","
283	},
284
285	/* Session options. */
286	{ .name = "activity-action",
287	  .type = OPTIONS_TABLE_CHOICE,
288	  .scope = OPTIONS_TABLE_SESSION,
289	  .choices = options_table_bell_action_list,
290	  .default_num = ALERT_OTHER
291	},
292
293	{ .name = "assume-paste-time",
294	  .type = OPTIONS_TABLE_NUMBER,
295	  .scope = OPTIONS_TABLE_SESSION,
296	  .minimum = 0,
297	  .maximum = INT_MAX,
298	  .default_num = 1,
299	},
300
301	{ .name = "base-index",
302	  .type = OPTIONS_TABLE_NUMBER,
303	  .scope = OPTIONS_TABLE_SESSION,
304	  .minimum = 0,
305	  .maximum = INT_MAX,
306	  .default_num = 0
307	},
308
309	{ .name = "bell-action",
310	  .type = OPTIONS_TABLE_CHOICE,
311	  .scope = OPTIONS_TABLE_SESSION,
312	  .choices = options_table_bell_action_list,
313	  .default_num = ALERT_ANY
314	},
315
316	{ .name = "default-command",
317	  .type = OPTIONS_TABLE_STRING,
318	  .scope = OPTIONS_TABLE_SESSION,
319	  .default_str = ""
320	},
321
322	{ .name = "default-shell",
323	  .type = OPTIONS_TABLE_STRING,
324	  .scope = OPTIONS_TABLE_SESSION,
325	  .default_str = _PATH_BSHELL
326	},
327
328	{ .name = "default-size",
329	  .type = OPTIONS_TABLE_STRING,
330	  .scope = OPTIONS_TABLE_SESSION,
331	  .pattern = "[0-9]*x[0-9]*",
332	  .default_str = "80x24"
333	},
334
335	{ .name = "destroy-unattached",
336	  .type = OPTIONS_TABLE_FLAG,
337	  .scope = OPTIONS_TABLE_SESSION,
338	  .default_num = 0
339	},
340
341	{ .name = "detach-on-destroy",
342	  .type = OPTIONS_TABLE_FLAG,
343	  .scope = OPTIONS_TABLE_SESSION,
344	  .default_num = 1
345	},
346
347	{ .name = "display-panes-active-colour",
348	  .type = OPTIONS_TABLE_COLOUR,
349	  .scope = OPTIONS_TABLE_SESSION,
350	  .default_num = 1
351	},
352
353	{ .name = "display-panes-colour",
354	  .type = OPTIONS_TABLE_COLOUR,
355	  .scope = OPTIONS_TABLE_SESSION,
356	  .default_num = 4
357	},
358
359	{ .name = "display-panes-time",
360	  .type = OPTIONS_TABLE_NUMBER,
361	  .scope = OPTIONS_TABLE_SESSION,
362	  .minimum = 1,
363	  .maximum = INT_MAX,
364	  .default_num = 1000
365	},
366
367	{ .name = "display-time",
368	  .type = OPTIONS_TABLE_NUMBER,
369	  .scope = OPTIONS_TABLE_SESSION,
370	  .minimum = 0,
371	  .maximum = INT_MAX,
372	  .default_num = 750
373	},
374
375	{ .name = "history-limit",
376	  .type = OPTIONS_TABLE_NUMBER,
377	  .scope = OPTIONS_TABLE_SESSION,
378	  .minimum = 0,
379	  .maximum = INT_MAX,
380	  .default_num = 2000
381	},
382
383	{ .name = "key-table",
384	  .type = OPTIONS_TABLE_STRING,
385	  .scope = OPTIONS_TABLE_SESSION,
386	  .default_str = "root"
387	},
388
389	{ .name = "lock-after-time",
390	  .type = OPTIONS_TABLE_NUMBER,
391	  .scope = OPTIONS_TABLE_SESSION,
392	  .minimum = 0,
393	  .maximum = INT_MAX,
394	  .default_num = 0
395	},
396
397	{ .name = "lock-command",
398	  .type = OPTIONS_TABLE_STRING,
399	  .scope = OPTIONS_TABLE_SESSION,
400	  .default_str = "lock -np"
401	},
402
403	{ .name = "message-command-style",
404	  .type = OPTIONS_TABLE_STRING,
405	  .scope = OPTIONS_TABLE_SESSION,
406	  .default_str = "bg=black,fg=yellow",
407	  .flags = OPTIONS_TABLE_IS_STYLE,
408	  .separator = ","
409	},
410
411	{ .name = "message-style",
412	  .type = OPTIONS_TABLE_STRING,
413	  .scope = OPTIONS_TABLE_SESSION,
414	  .default_str = "bg=yellow,fg=black",
415	  .flags = OPTIONS_TABLE_IS_STYLE,
416	  .separator = ","
417	},
418
419	{ .name = "mouse",
420	  .type = OPTIONS_TABLE_FLAG,
421	  .scope = OPTIONS_TABLE_SESSION,
422	  .default_num = 0
423	},
424
425	{ .name = "prefix",
426	  .type = OPTIONS_TABLE_KEY,
427	  .scope = OPTIONS_TABLE_SESSION,
428	  .default_num = '\002',
429	},
430
431	{ .name = "prefix2",
432	  .type = OPTIONS_TABLE_KEY,
433	  .scope = OPTIONS_TABLE_SESSION,
434	  .default_num = KEYC_NONE,
435	},
436
437	{ .name = "renumber-windows",
438	  .type = OPTIONS_TABLE_FLAG,
439	  .scope = OPTIONS_TABLE_SESSION,
440	  .default_num = 0
441	},
442
443	{ .name = "repeat-time",
444	  .type = OPTIONS_TABLE_NUMBER,
445	  .scope = OPTIONS_TABLE_SESSION,
446	  .minimum = 0,
447	  .maximum = SHRT_MAX,
448	  .default_num = 500
449	},
450
451	{ .name = "set-titles",
452	  .type = OPTIONS_TABLE_FLAG,
453	  .scope = OPTIONS_TABLE_SESSION,
454	  .default_num = 0
455	},
456
457	{ .name = "set-titles-string",
458	  .type = OPTIONS_TABLE_STRING,
459	  .scope = OPTIONS_TABLE_SESSION,
460	  .default_str = "#S:#I:#W - \"#T\" #{session_alerts}"
461	},
462
463	{ .name = "silence-action",
464	  .type = OPTIONS_TABLE_CHOICE,
465	  .scope = OPTIONS_TABLE_SESSION,
466	  .choices = options_table_bell_action_list,
467	  .default_num = ALERT_OTHER
468	},
469
470	{ .name = "status",
471	  .type = OPTIONS_TABLE_CHOICE,
472	  .scope = OPTIONS_TABLE_SESSION,
473	  .choices = options_table_status_list,
474	  .default_num = 1
475	},
476
477	{ .name = "status-bg",
478	  .type = OPTIONS_TABLE_COLOUR,
479	  .scope = OPTIONS_TABLE_SESSION,
480	  .default_num = 8,
481	},
482
483	{ .name = "status-fg",
484	  .type = OPTIONS_TABLE_COLOUR,
485	  .scope = OPTIONS_TABLE_SESSION,
486	  .default_num = 8,
487	},
488
489	{ .name = "status-format",
490	  .type = OPTIONS_TABLE_STRING,
491	  .scope = OPTIONS_TABLE_SESSION,
492	  .flags = OPTIONS_TABLE_IS_ARRAY,
493	  .default_arr = options_table_status_format_default,
494	},
495
496	{ .name = "status-interval",
497	  .type = OPTIONS_TABLE_NUMBER,
498	  .scope = OPTIONS_TABLE_SESSION,
499	  .minimum = 0,
500	  .maximum = INT_MAX,
501	  .default_num = 15
502	},
503
504	{ .name = "status-justify",
505	  .type = OPTIONS_TABLE_CHOICE,
506	  .scope = OPTIONS_TABLE_SESSION,
507	  .choices = options_table_status_justify_list,
508	  .default_num = 0
509	},
510
511	{ .name = "status-keys",
512	  .type = OPTIONS_TABLE_CHOICE,
513	  .scope = OPTIONS_TABLE_SESSION,
514	  .choices = options_table_status_keys_list,
515	  .default_num = MODEKEY_EMACS
516	},
517
518	{ .name = "status-left",
519	  .type = OPTIONS_TABLE_STRING,
520	  .scope = OPTIONS_TABLE_SESSION,
521	  .default_str = "[#S] "
522	},
523
524	{ .name = "status-left-length",
525	  .type = OPTIONS_TABLE_NUMBER,
526	  .scope = OPTIONS_TABLE_SESSION,
527	  .minimum = 0,
528	  .maximum = SHRT_MAX,
529	  .default_num = 10
530	},
531
532	{ .name = "status-left-style",
533	  .type = OPTIONS_TABLE_STRING,
534	  .scope = OPTIONS_TABLE_SESSION,
535	  .default_str = "default",
536	  .flags = OPTIONS_TABLE_IS_STYLE,
537	  .separator = ","
538	},
539
540	{ .name = "status-position",
541	  .type = OPTIONS_TABLE_CHOICE,
542	  .scope = OPTIONS_TABLE_SESSION,
543	  .choices = options_table_status_position_list,
544	  .default_num = 1
545	},
546
547	{ .name = "status-right",
548	  .type = OPTIONS_TABLE_STRING,
549	  .scope = OPTIONS_TABLE_SESSION,
550	  .default_str = "#{?window_bigger,"
551	                 "[#{window_offset_x}#,#{window_offset_y}] ,}"
552	                 "\"#{=21:pane_title}\" %H:%M %d-%b-%y"
553	},
554
555	{ .name = "status-right-length",
556	  .type = OPTIONS_TABLE_NUMBER,
557	  .scope = OPTIONS_TABLE_SESSION,
558	  .minimum = 0,
559	  .maximum = SHRT_MAX,
560	  .default_num = 40
561	},
562
563	{ .name = "status-right-style",
564	  .type = OPTIONS_TABLE_STRING,
565	  .scope = OPTIONS_TABLE_SESSION,
566	  .default_str = "default",
567	  .flags = OPTIONS_TABLE_IS_STYLE,
568	  .separator = ","
569	},
570
571	{ .name = "status-style",
572	  .type = OPTIONS_TABLE_STRING,
573	  .scope = OPTIONS_TABLE_SESSION,
574	  .default_str = "bg=green,fg=black",
575	  .flags = OPTIONS_TABLE_IS_STYLE,
576	  .separator = ","
577	},
578
579	{ .name = "update-environment",
580	  .type = OPTIONS_TABLE_STRING,
581	  .scope = OPTIONS_TABLE_SESSION,
582	  .flags = OPTIONS_TABLE_IS_ARRAY,
583	  .default_str = "DISPLAY KRB5CCNAME SSH_ASKPASS SSH_AUTH_SOCK "
584	  		 "SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY"
585	},
586
587	{ .name = "visual-activity",
588	  .type = OPTIONS_TABLE_CHOICE,
589	  .scope = OPTIONS_TABLE_SESSION,
590	  .choices = options_table_visual_bell_list,
591	  .default_num = VISUAL_OFF
592	},
593
594	{ .name = "visual-bell",
595	  .type = OPTIONS_TABLE_CHOICE,
596	  .scope = OPTIONS_TABLE_SESSION,
597	  .choices = options_table_visual_bell_list,
598	  .default_num = VISUAL_OFF
599	},
600
601	{ .name = "visual-silence",
602	  .type = OPTIONS_TABLE_CHOICE,
603	  .scope = OPTIONS_TABLE_SESSION,
604	  .choices = options_table_visual_bell_list,
605	  .default_num = VISUAL_OFF
606	},
607
608	{ .name = "word-separators",
609	  .type = OPTIONS_TABLE_STRING,
610	  .scope = OPTIONS_TABLE_SESSION,
611	  .default_str = " "
612	},
613
614	/* Window options. */
615	{ .name = "aggressive-resize",
616	  .type = OPTIONS_TABLE_FLAG,
617	  .scope = OPTIONS_TABLE_WINDOW,
618	  .default_num = 0
619	},
620
621	{ .name = "allow-rename",
622	  .type = OPTIONS_TABLE_FLAG,
623	  .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
624	  .default_num = 0
625	},
626
627	{ .name = "alternate-screen",
628	  .type = OPTIONS_TABLE_FLAG,
629	  .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
630	  .default_num = 1
631	},
632
633	{ .name = "automatic-rename",
634	  .type = OPTIONS_TABLE_FLAG,
635	  .scope = OPTIONS_TABLE_WINDOW,
636	  .default_num = 1
637	},
638
639	{ .name = "automatic-rename-format",
640	  .type = OPTIONS_TABLE_STRING,
641	  .scope = OPTIONS_TABLE_WINDOW,
642	  .default_str = "#{?pane_in_mode,[tmux],#{pane_current_command}}"
643			 "#{?pane_dead,[dead],}"
644	},
645
646	{ .name = "clock-mode-colour",
647	  .type = OPTIONS_TABLE_COLOUR,
648	  .scope = OPTIONS_TABLE_WINDOW,
649	  .default_num = 4
650	},
651
652	{ .name = "clock-mode-style",
653	  .type = OPTIONS_TABLE_CHOICE,
654	  .scope = OPTIONS_TABLE_WINDOW,
655	  .choices = options_table_clock_mode_style_list,
656	  .default_num = 1
657	},
658
659	{ .name = "main-pane-height",
660	  .type = OPTIONS_TABLE_STRING,
661	  .scope = OPTIONS_TABLE_WINDOW,
662	  .default_str = "24"
663	},
664
665	{ .name = "main-pane-width",
666	  .type = OPTIONS_TABLE_STRING,
667	  .scope = OPTIONS_TABLE_WINDOW,
668	  .default_str = "80"
669	},
670
671	{ .name = "mode-keys",
672	  .type = OPTIONS_TABLE_CHOICE,
673	  .scope = OPTIONS_TABLE_WINDOW,
674	  .choices = options_table_mode_keys_list,
675	  .default_num = MODEKEY_EMACS
676	},
677
678	{ .name = "mode-style",
679	  .type = OPTIONS_TABLE_STRING,
680	  .scope = OPTIONS_TABLE_WINDOW,
681	  .default_str = "bg=yellow,fg=black",
682	  .flags = OPTIONS_TABLE_IS_STYLE,
683	  .separator = ","
684	},
685
686	{ .name = "monitor-activity",
687	  .type = OPTIONS_TABLE_FLAG,
688	  .scope = OPTIONS_TABLE_WINDOW,
689	  .default_num = 0
690	},
691
692	{ .name = "monitor-bell",
693	  .type = OPTIONS_TABLE_FLAG,
694	  .scope = OPTIONS_TABLE_WINDOW,
695	  .default_num = 1
696	},
697
698	{ .name = "monitor-silence",
699	  .type = OPTIONS_TABLE_NUMBER,
700	  .scope = OPTIONS_TABLE_WINDOW,
701	  .minimum = 0,
702	  .maximum = INT_MAX,
703	  .default_num = 0
704	},
705
706	{ .name = "other-pane-height",
707	  .type = OPTIONS_TABLE_STRING,
708	  .scope = OPTIONS_TABLE_WINDOW,
709	  .default_str = "0"
710	},
711
712	{ .name = "other-pane-width",
713	  .type = OPTIONS_TABLE_STRING,
714	  .scope = OPTIONS_TABLE_WINDOW,
715	  .default_str = "0"
716	},
717
718	{ .name = "pane-active-border-style",
719	  .type = OPTIONS_TABLE_STRING,
720	  .scope = OPTIONS_TABLE_WINDOW,
721	  .default_str = "#{?pane_in_mode,fg=yellow,#{?synchronize-panes,fg=red,fg=green}}",
722	  .flags = OPTIONS_TABLE_IS_STYLE,
723	  .separator = ","
724	},
725
726	{ .name = "pane-base-index",
727	  .type = OPTIONS_TABLE_NUMBER,
728	  .scope = OPTIONS_TABLE_WINDOW,
729	  .minimum = 0,
730	  .maximum = USHRT_MAX,
731	  .default_num = 0
732	},
733
734	{ .name = "pane-border-format",
735	  .type = OPTIONS_TABLE_STRING,
736	  .scope = OPTIONS_TABLE_WINDOW,
737	  .default_str = "#{?pane_active,#[reverse],}#{pane_index}#[default] "
738			 "\"#{pane_title}\""
739	},
740
741	{ .name = "pane-border-status",
742	  .type = OPTIONS_TABLE_CHOICE,
743	  .scope = OPTIONS_TABLE_WINDOW,
744	  .choices = options_table_pane_status_list,
745	  .default_num = PANE_STATUS_OFF
746	},
747
748	{ .name = "pane-border-style",
749	  .type = OPTIONS_TABLE_STRING,
750	  .scope = OPTIONS_TABLE_WINDOW,
751	  .default_str = "default",
752	  .flags = OPTIONS_TABLE_IS_STYLE,
753	  .separator = ","
754	},
755
756	{ .name = "remain-on-exit",
757	  .type = OPTIONS_TABLE_FLAG,
758	  .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
759	  .default_num = 0
760	},
761
762	{ .name = "synchronize-panes",
763	  .type = OPTIONS_TABLE_FLAG,
764	  .scope = OPTIONS_TABLE_WINDOW,
765	  .default_num = 0
766	},
767
768	{ .name = "window-active-style",
769	  .type = OPTIONS_TABLE_STRING,
770	  .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
771	  .default_str = "default",
772	  .flags = OPTIONS_TABLE_IS_STYLE,
773	  .separator = ","
774	},
775
776	{ .name = "window-size",
777	  .type = OPTIONS_TABLE_CHOICE,
778	  .scope = OPTIONS_TABLE_WINDOW,
779	  .choices = options_table_window_size_list,
780	  .default_num = WINDOW_SIZE_LATEST
781	},
782
783	{ .name = "window-style",
784	  .type = OPTIONS_TABLE_STRING,
785	  .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
786	  .default_str = "default",
787	  .flags = OPTIONS_TABLE_IS_STYLE,
788	  .separator = ","
789	},
790
791	{ .name = "window-status-activity-style",
792	  .type = OPTIONS_TABLE_STRING,
793	  .scope = OPTIONS_TABLE_WINDOW,
794	  .default_str = "reverse",
795	  .flags = OPTIONS_TABLE_IS_STYLE,
796	  .separator = ","
797	},
798
799	{ .name = "window-status-bell-style",
800	  .type = OPTIONS_TABLE_STRING,
801	  .scope = OPTIONS_TABLE_WINDOW,
802	  .default_str = "reverse",
803	  .flags = OPTIONS_TABLE_IS_STYLE,
804	  .separator = ","
805	},
806
807	{ .name = "window-status-current-format",
808	  .type = OPTIONS_TABLE_STRING,
809	  .scope = OPTIONS_TABLE_WINDOW,
810	  .default_str = "#I:#W#{?window_flags,#{window_flags}, }"
811	},
812
813	{ .name = "window-status-current-style",
814	  .type = OPTIONS_TABLE_STRING,
815	  .scope = OPTIONS_TABLE_WINDOW,
816	  .default_str = "default",
817	  .flags = OPTIONS_TABLE_IS_STYLE,
818	  .separator = ","
819	},
820
821	{ .name = "window-status-format",
822	  .type = OPTIONS_TABLE_STRING,
823	  .scope = OPTIONS_TABLE_WINDOW,
824	  .default_str = "#I:#W#{?window_flags,#{window_flags}, }"
825	},
826
827	{ .name = "window-status-last-style",
828	  .type = OPTIONS_TABLE_STRING,
829	  .scope = OPTIONS_TABLE_WINDOW,
830	  .default_str = "default",
831	  .flags = OPTIONS_TABLE_IS_STYLE,
832	  .separator = ","
833	},
834
835	{ .name = "window-status-separator",
836	  .type = OPTIONS_TABLE_STRING,
837	  .scope = OPTIONS_TABLE_WINDOW,
838	  .default_str = " "
839	},
840
841	{ .name = "window-status-style",
842	  .type = OPTIONS_TABLE_STRING,
843	  .scope = OPTIONS_TABLE_WINDOW,
844	  .default_str = "default",
845	  .flags = OPTIONS_TABLE_IS_STYLE,
846	  .separator = ","
847	},
848
849	{ .name = "wrap-search",
850	  .type = OPTIONS_TABLE_FLAG,
851	  .scope = OPTIONS_TABLE_WINDOW,
852	  .default_num = 1
853	},
854
855	{ .name = "xterm-keys",
856	  .type = OPTIONS_TABLE_FLAG,
857	  .scope = OPTIONS_TABLE_WINDOW,
858	  .default_num = 1
859	},
860
861	/* Hook options. */
862	OPTIONS_TABLE_HOOK("after-bind-key", ""),
863	OPTIONS_TABLE_HOOK("after-capture-pane", ""),
864	OPTIONS_TABLE_HOOK("after-copy-mode", ""),
865	OPTIONS_TABLE_HOOK("after-display-message", ""),
866	OPTIONS_TABLE_HOOK("after-display-panes", ""),
867	OPTIONS_TABLE_HOOK("after-kill-pane", ""),
868	OPTIONS_TABLE_HOOK("after-list-buffers", ""),
869	OPTIONS_TABLE_HOOK("after-list-clients", ""),
870	OPTIONS_TABLE_HOOK("after-list-keys", ""),
871	OPTIONS_TABLE_HOOK("after-list-panes", ""),
872	OPTIONS_TABLE_HOOK("after-list-sessions", ""),
873	OPTIONS_TABLE_HOOK("after-list-windows", ""),
874	OPTIONS_TABLE_HOOK("after-load-buffer", ""),
875	OPTIONS_TABLE_HOOK("after-lock-server", ""),
876	OPTIONS_TABLE_HOOK("after-new-session", ""),
877	OPTIONS_TABLE_HOOK("after-new-window", ""),
878	OPTIONS_TABLE_HOOK("after-paste-buffer", ""),
879	OPTIONS_TABLE_HOOK("after-pipe-pane", ""),
880	OPTIONS_TABLE_HOOK("after-queue", ""),
881	OPTIONS_TABLE_HOOK("after-refresh-client", ""),
882	OPTIONS_TABLE_HOOK("after-rename-session", ""),
883	OPTIONS_TABLE_HOOK("after-rename-window", ""),
884	OPTIONS_TABLE_HOOK("after-resize-pane", ""),
885	OPTIONS_TABLE_HOOK("after-resize-window", ""),
886	OPTIONS_TABLE_HOOK("after-save-buffer", ""),
887	OPTIONS_TABLE_HOOK("after-select-layout", ""),
888	OPTIONS_TABLE_HOOK("after-select-pane", ""),
889	OPTIONS_TABLE_HOOK("after-select-window", ""),
890	OPTIONS_TABLE_HOOK("after-send-keys", ""),
891	OPTIONS_TABLE_HOOK("after-set-buffer", ""),
892	OPTIONS_TABLE_HOOK("after-set-environment", ""),
893	OPTIONS_TABLE_HOOK("after-set-hook", ""),
894	OPTIONS_TABLE_HOOK("after-set-option", ""),
895	OPTIONS_TABLE_HOOK("after-show-environment", ""),
896	OPTIONS_TABLE_HOOK("after-show-messages", ""),
897	OPTIONS_TABLE_HOOK("after-show-options", ""),
898	OPTIONS_TABLE_HOOK("after-split-window", ""),
899	OPTIONS_TABLE_HOOK("after-unbind-key", ""),
900	OPTIONS_TABLE_HOOK("alert-activity", ""),
901	OPTIONS_TABLE_HOOK("alert-bell", ""),
902	OPTIONS_TABLE_HOOK("alert-silence", ""),
903	OPTIONS_TABLE_HOOK("client-attached", ""),
904	OPTIONS_TABLE_HOOK("client-detached", ""),
905	OPTIONS_TABLE_HOOK("client-resized", ""),
906	OPTIONS_TABLE_HOOK("client-session-changed", ""),
907	OPTIONS_TABLE_PANE_HOOK("pane-died", ""),
908	OPTIONS_TABLE_PANE_HOOK("pane-exited", ""),
909	OPTIONS_TABLE_PANE_HOOK("pane-focus-in", ""),
910	OPTIONS_TABLE_PANE_HOOK("pane-focus-out", ""),
911	OPTIONS_TABLE_PANE_HOOK("pane-mode-changed", ""),
912	OPTIONS_TABLE_PANE_HOOK("pane-set-clipboard", ""),
913	OPTIONS_TABLE_HOOK("session-closed", ""),
914	OPTIONS_TABLE_HOOK("session-created", ""),
915	OPTIONS_TABLE_HOOK("session-renamed", ""),
916	OPTIONS_TABLE_HOOK("session-window-changed", ""),
917	OPTIONS_TABLE_WINDOW_HOOK("window-layout-changed", ""),
918	OPTIONS_TABLE_WINDOW_HOOK("window-linked", ""),
919	OPTIONS_TABLE_WINDOW_HOOK("window-pane-changed", ""),
920	OPTIONS_TABLE_WINDOW_HOOK("window-renamed", ""),
921	OPTIONS_TABLE_WINDOW_HOOK("window-unlinked", ""),
922
923	{ .name = NULL }
924};
925