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