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