Annotation of src/usr.bin/tmux/options-table.c, Revision 1.126
1.126 ! nicm 1: /* $OpenBSD: options-table.c,v 1.125 2020/05/16 15:24:28 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"
1.125 nicm 211: },
212:
213: { .name = "editor",
214: .type = OPTIONS_TABLE_STRING,
215: .scope = OPTIONS_TABLE_SERVER,
216: .default_str = _PATH_VI
1.56 nicm 217: },
218:
1.1 nicm 219: { .name = "escape-time",
220: .type = OPTIONS_TABLE_NUMBER,
1.67 nicm 221: .scope = OPTIONS_TABLE_SERVER,
1.1 nicm 222: .minimum = 0,
223: .maximum = INT_MAX,
224: .default_num = 500
1.95 nicm 225: },
226:
227: { .name = "exit-empty",
228: .type = OPTIONS_TABLE_FLAG,
229: .scope = OPTIONS_TABLE_SERVER,
230: .default_num = 1
1.1 nicm 231: },
232:
233: { .name = "exit-unattached",
1.38 nicm 234: .type = OPTIONS_TABLE_FLAG,
1.67 nicm 235: .scope = OPTIONS_TABLE_SERVER,
1.38 nicm 236: .default_num = 0
237: },
238:
239: { .name = "focus-events",
1.1 nicm 240: .type = OPTIONS_TABLE_FLAG,
1.67 nicm 241: .scope = OPTIONS_TABLE_SERVER,
1.1 nicm 242: .default_num = 0
1.61 nicm 243: },
244:
245: { .name = "history-file",
246: .type = OPTIONS_TABLE_STRING,
1.67 nicm 247: .scope = OPTIONS_TABLE_SERVER,
1.65 nicm 248: .default_str = ""
1.1 nicm 249: },
250:
1.46 nicm 251: { .name = "message-limit",
252: .type = OPTIONS_TABLE_NUMBER,
1.67 nicm 253: .scope = OPTIONS_TABLE_SERVER,
1.46 nicm 254: .minimum = 0,
255: .maximum = INT_MAX,
1.126 ! nicm 256: .default_num = 1000
1.1 nicm 257: },
258:
1.8 nicm 259: { .name = "set-clipboard",
1.89 nicm 260: .type = OPTIONS_TABLE_CHOICE,
1.67 nicm 261: .scope = OPTIONS_TABLE_SERVER,
1.89 nicm 262: .choices = options_table_set_clipboard_list,
1.8 nicm 263: .default_num = 1
264: },
265:
1.45 nicm 266: { .name = "terminal-overrides",
1.104 nicm 267: .type = OPTIONS_TABLE_STRING,
1.67 nicm 268: .scope = OPTIONS_TABLE_SERVER,
1.104 nicm 269: .flags = OPTIONS_TABLE_IS_ARRAY,
1.122 nicm 270: .default_str = "",
1.118 nicm 271: .separator = ","
272: },
273:
274: { .name = "terminal-features",
275: .type = OPTIONS_TABLE_STRING,
276: .scope = OPTIONS_TABLE_SERVER,
277: .flags = OPTIONS_TABLE_IS_ARRAY,
278: .default_str = "xterm*:clipboard:ccolour:cstyle:title,"
279: "screen*:title",
1.90 nicm 280: .separator = ","
281: },
282:
283: { .name = "user-keys",
1.104 nicm 284: .type = OPTIONS_TABLE_STRING,
1.90 nicm 285: .scope = OPTIONS_TABLE_SERVER,
1.104 nicm 286: .flags = OPTIONS_TABLE_IS_ARRAY,
1.90 nicm 287: .default_str = "",
1.85 nicm 288: .separator = ","
1.45 nicm 289: },
290:
1.105 nicm 291: /* Session options. */
1.91 nicm 292: { .name = "activity-action",
293: .type = OPTIONS_TABLE_CHOICE,
294: .scope = OPTIONS_TABLE_SESSION,
295: .choices = options_table_bell_action_list,
1.92 nicm 296: .default_num = ALERT_OTHER
1.91 nicm 297: },
298:
1.31 nicm 299: { .name = "assume-paste-time",
300: .type = OPTIONS_TABLE_NUMBER,
1.67 nicm 301: .scope = OPTIONS_TABLE_SESSION,
1.31 nicm 302: .minimum = 0,
303: .maximum = INT_MAX,
304: .default_num = 1,
305: },
306:
1.1 nicm 307: { .name = "base-index",
308: .type = OPTIONS_TABLE_NUMBER,
1.67 nicm 309: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 310: .minimum = 0,
311: .maximum = INT_MAX,
312: .default_num = 0
313: },
314:
315: { .name = "bell-action",
316: .type = OPTIONS_TABLE_CHOICE,
1.67 nicm 317: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 318: .choices = options_table_bell_action_list,
1.92 nicm 319: .default_num = ALERT_ANY
1.11 nicm 320: },
321:
1.1 nicm 322: { .name = "default-command",
323: .type = OPTIONS_TABLE_STRING,
1.67 nicm 324: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 325: .default_str = ""
326: },
327:
328: { .name = "default-shell",
329: .type = OPTIONS_TABLE_STRING,
1.67 nicm 330: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 331: .default_str = _PATH_BSHELL
332: },
333:
1.97 nicm 334: { .name = "default-size",
335: .type = OPTIONS_TABLE_STRING,
336: .scope = OPTIONS_TABLE_SESSION,
337: .pattern = "[0-9]*x[0-9]*",
338: .default_str = "80x24"
339: },
340:
1.1 nicm 341: { .name = "destroy-unattached",
342: .type = OPTIONS_TABLE_FLAG,
1.67 nicm 343: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 344: .default_num = 0
345: },
346:
347: { .name = "detach-on-destroy",
348: .type = OPTIONS_TABLE_FLAG,
1.67 nicm 349: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 350: .default_num = 1
351: },
352:
353: { .name = "display-panes-active-colour",
354: .type = OPTIONS_TABLE_COLOUR,
1.67 nicm 355: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 356: .default_num = 1
357: },
358:
359: { .name = "display-panes-colour",
360: .type = OPTIONS_TABLE_COLOUR,
1.67 nicm 361: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 362: .default_num = 4
363: },
364:
365: { .name = "display-panes-time",
366: .type = OPTIONS_TABLE_NUMBER,
1.67 nicm 367: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 368: .minimum = 1,
369: .maximum = INT_MAX,
370: .default_num = 1000
371: },
372:
373: { .name = "display-time",
374: .type = OPTIONS_TABLE_NUMBER,
1.67 nicm 375: .scope = OPTIONS_TABLE_SESSION,
1.68 tim 376: .minimum = 0,
1.1 nicm 377: .maximum = INT_MAX,
378: .default_num = 750
379: },
380:
381: { .name = "history-limit",
382: .type = OPTIONS_TABLE_NUMBER,
1.67 nicm 383: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 384: .minimum = 0,
1.3 nicm 385: .maximum = INT_MAX,
1.1 nicm 386: .default_num = 2000
1.70 nicm 387: },
388:
389: { .name = "key-table",
390: .type = OPTIONS_TABLE_STRING,
391: .scope = OPTIONS_TABLE_SESSION,
392: .default_str = "root"
1.1 nicm 393: },
394:
395: { .name = "lock-after-time",
396: .type = OPTIONS_TABLE_NUMBER,
1.67 nicm 397: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 398: .minimum = 0,
399: .maximum = INT_MAX,
400: .default_num = 0
401: },
402:
403: { .name = "lock-command",
404: .type = OPTIONS_TABLE_STRING,
1.67 nicm 405: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 406: .default_str = "lock -np"
407: },
408:
1.43 nicm 409: { .name = "message-command-style",
1.123 nicm 410: .type = OPTIONS_TABLE_STRING,
1.67 nicm 411: .scope = OPTIONS_TABLE_SESSION,
1.123 nicm 412: .default_str = "bg=black,fg=yellow",
413: .flags = OPTIONS_TABLE_IS_STYLE,
414: .separator = ","
1.1 nicm 415: },
416:
1.43 nicm 417: { .name = "message-style",
1.123 nicm 418: .type = OPTIONS_TABLE_STRING,
1.67 nicm 419: .scope = OPTIONS_TABLE_SESSION,
1.123 nicm 420: .default_str = "bg=yellow,fg=black",
421: .flags = OPTIONS_TABLE_IS_STYLE,
422: .separator = ","
1.43 nicm 423: },
424:
1.55 nicm 425: { .name = "mouse",
1.1 nicm 426: .type = OPTIONS_TABLE_FLAG,
1.67 nicm 427: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 428: .default_num = 0
429: },
430:
431: { .name = "prefix",
1.19 nicm 432: .type = OPTIONS_TABLE_KEY,
1.67 nicm 433: .scope = OPTIONS_TABLE_SESSION,
1.19 nicm 434: .default_num = '\002',
435: },
436:
437: { .name = "prefix2",
438: .type = OPTIONS_TABLE_KEY,
1.67 nicm 439: .scope = OPTIONS_TABLE_SESSION,
1.19 nicm 440: .default_num = KEYC_NONE,
1.29 nicm 441: },
442:
443: { .name = "renumber-windows",
444: .type = OPTIONS_TABLE_FLAG,
1.67 nicm 445: .scope = OPTIONS_TABLE_SESSION,
1.29 nicm 446: .default_num = 0
1.1 nicm 447: },
448:
449: { .name = "repeat-time",
450: .type = OPTIONS_TABLE_NUMBER,
1.67 nicm 451: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 452: .minimum = 0,
453: .maximum = SHRT_MAX,
454: .default_num = 500
455: },
456:
457: { .name = "set-titles",
458: .type = OPTIONS_TABLE_FLAG,
1.67 nicm 459: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 460: .default_num = 0
461: },
462:
463: { .name = "set-titles-string",
464: .type = OPTIONS_TABLE_STRING,
1.67 nicm 465: .scope = OPTIONS_TABLE_SESSION,
1.60 nicm 466: .default_str = "#S:#I:#W - \"#T\" #{session_alerts}"
1.1 nicm 467: },
468:
1.91 nicm 469: { .name = "silence-action",
470: .type = OPTIONS_TABLE_CHOICE,
471: .scope = OPTIONS_TABLE_SESSION,
472: .choices = options_table_bell_action_list,
1.92 nicm 473: .default_num = ALERT_OTHER
1.91 nicm 474: },
475:
1.1 nicm 476: { .name = "status",
1.99 nicm 477: .type = OPTIONS_TABLE_CHOICE,
1.67 nicm 478: .scope = OPTIONS_TABLE_SESSION,
1.99 nicm 479: .choices = options_table_status_list,
1.1 nicm 480: .default_num = 1
481: },
482:
483: { .name = "status-bg",
484: .type = OPTIONS_TABLE_COLOUR,
1.67 nicm 485: .scope = OPTIONS_TABLE_SESSION,
1.123 nicm 486: .default_num = 8,
1.1 nicm 487: },
488:
489: { .name = "status-fg",
490: .type = OPTIONS_TABLE_COLOUR,
1.67 nicm 491: .scope = OPTIONS_TABLE_SESSION,
1.123 nicm 492: .default_num = 8,
1.99 nicm 493: },
494:
495: { .name = "status-format",
1.104 nicm 496: .type = OPTIONS_TABLE_STRING,
1.99 nicm 497: .scope = OPTIONS_TABLE_SESSION,
1.104 nicm 498: .flags = OPTIONS_TABLE_IS_ARRAY,
1.99 nicm 499: .default_arr = options_table_status_format_default,
1.1 nicm 500: },
501:
502: { .name = "status-interval",
503: .type = OPTIONS_TABLE_NUMBER,
1.67 nicm 504: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 505: .minimum = 0,
506: .maximum = INT_MAX,
507: .default_num = 15
508: },
509:
510: { .name = "status-justify",
511: .type = OPTIONS_TABLE_CHOICE,
1.67 nicm 512: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 513: .choices = options_table_status_justify_list,
514: .default_num = 0
515: },
516:
517: { .name = "status-keys",
518: .type = OPTIONS_TABLE_CHOICE,
1.67 nicm 519: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 520: .choices = options_table_status_keys_list,
521: .default_num = MODEKEY_EMACS
522: },
523:
524: { .name = "status-left",
525: .type = OPTIONS_TABLE_STRING,
1.67 nicm 526: .scope = OPTIONS_TABLE_SESSION,
1.51 nicm 527: .default_str = "[#S] "
1.1 nicm 528: },
529:
530: { .name = "status-left-length",
531: .type = OPTIONS_TABLE_NUMBER,
1.67 nicm 532: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 533: .minimum = 0,
534: .maximum = SHRT_MAX,
535: .default_num = 10
1.20 nicm 536: },
537:
1.43 nicm 538: { .name = "status-left-style",
1.123 nicm 539: .type = OPTIONS_TABLE_STRING,
1.67 nicm 540: .scope = OPTIONS_TABLE_SESSION,
1.123 nicm 541: .default_str = "default",
542: .flags = OPTIONS_TABLE_IS_STYLE,
543: .separator = ","
1.43 nicm 544: },
545:
1.20 nicm 546: { .name = "status-position",
547: .type = OPTIONS_TABLE_CHOICE,
1.67 nicm 548: .scope = OPTIONS_TABLE_SESSION,
1.20 nicm 549: .choices = options_table_status_position_list,
550: .default_num = 1
1.1 nicm 551: },
552:
553: { .name = "status-right",
554: .type = OPTIONS_TABLE_STRING,
1.67 nicm 555: .scope = OPTIONS_TABLE_SESSION,
1.97 nicm 556: .default_str = "#{?window_bigger,"
557: "[#{window_offset_x}#,#{window_offset_y}] ,}"
558: "\"#{=21:pane_title}\" %H:%M %d-%b-%y"
1.1 nicm 559: },
560:
561: { .name = "status-right-length",
562: .type = OPTIONS_TABLE_NUMBER,
1.67 nicm 563: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 564: .minimum = 0,
565: .maximum = SHRT_MAX,
566: .default_num = 40
567: },
568:
1.43 nicm 569: { .name = "status-right-style",
1.123 nicm 570: .type = OPTIONS_TABLE_STRING,
1.67 nicm 571: .scope = OPTIONS_TABLE_SESSION,
1.123 nicm 572: .default_str = "default",
573: .flags = OPTIONS_TABLE_IS_STYLE,
574: .separator = ","
1.43 nicm 575: },
576:
577: { .name = "status-style",
1.123 nicm 578: .type = OPTIONS_TABLE_STRING,
1.67 nicm 579: .scope = OPTIONS_TABLE_SESSION,
1.123 nicm 580: .default_str = "bg=green,fg=black",
581: .flags = OPTIONS_TABLE_IS_STYLE,
582: .separator = ","
1.43 nicm 583: },
584:
1.1 nicm 585: { .name = "update-environment",
1.104 nicm 586: .type = OPTIONS_TABLE_STRING,
1.67 nicm 587: .scope = OPTIONS_TABLE_SESSION,
1.104 nicm 588: .flags = OPTIONS_TABLE_IS_ARRAY,
1.96 nicm 589: .default_str = "DISPLAY KRB5CCNAME SSH_ASKPASS SSH_AUTH_SOCK "
590: "SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY"
1.1 nicm 591: },
592:
593: { .name = "visual-activity",
1.91 nicm 594: .type = OPTIONS_TABLE_CHOICE,
1.67 nicm 595: .scope = OPTIONS_TABLE_SESSION,
1.91 nicm 596: .choices = options_table_visual_bell_list,
597: .default_num = VISUAL_OFF
1.1 nicm 598: },
599:
600: { .name = "visual-bell",
1.91 nicm 601: .type = OPTIONS_TABLE_CHOICE,
1.67 nicm 602: .scope = OPTIONS_TABLE_SESSION,
1.91 nicm 603: .choices = options_table_visual_bell_list,
604: .default_num = VISUAL_OFF
1.1 nicm 605: },
606:
607: { .name = "visual-silence",
1.91 nicm 608: .type = OPTIONS_TABLE_CHOICE,
1.67 nicm 609: .scope = OPTIONS_TABLE_SESSION,
1.91 nicm 610: .choices = options_table_visual_bell_list,
611: .default_num = VISUAL_OFF
1.1 nicm 612: },
613:
1.16 nicm 614: { .name = "word-separators",
615: .type = OPTIONS_TABLE_STRING,
1.67 nicm 616: .scope = OPTIONS_TABLE_SESSION,
1.106 nicm 617: .default_str = " "
1.16 nicm 618: },
619:
1.105 nicm 620: /* Window options. */
1.1 nicm 621: { .name = "aggressive-resize",
622: .type = OPTIONS_TABLE_FLAG,
1.67 nicm 623: .scope = OPTIONS_TABLE_WINDOW,
1.1 nicm 624: .default_num = 0
1.17 nicm 625: },
626:
627: { .name = "allow-rename",
628: .type = OPTIONS_TABLE_FLAG,
1.108 nicm 629: .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
1.94 nicm 630: .default_num = 0
1.1 nicm 631: },
632:
633: { .name = "alternate-screen",
634: .type = OPTIONS_TABLE_FLAG,
1.108 nicm 635: .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
1.1 nicm 636: .default_num = 1
637: },
638:
639: { .name = "automatic-rename",
640: .type = OPTIONS_TABLE_FLAG,
1.67 nicm 641: .scope = OPTIONS_TABLE_WINDOW,
1.1 nicm 642: .default_num = 1
1.41 nicm 643: },
644:
645: { .name = "automatic-rename-format",
646: .type = OPTIONS_TABLE_STRING,
1.67 nicm 647: .scope = OPTIONS_TABLE_WINDOW,
1.50 nicm 648: .default_str = "#{?pane_in_mode,[tmux],#{pane_current_command}}"
1.87 nicm 649: "#{?pane_dead,[dead],}"
1.1 nicm 650: },
651:
652: { .name = "clock-mode-colour",
653: .type = OPTIONS_TABLE_COLOUR,
1.67 nicm 654: .scope = OPTIONS_TABLE_WINDOW,
1.1 nicm 655: .default_num = 4
656: },
657:
658: { .name = "clock-mode-style",
659: .type = OPTIONS_TABLE_CHOICE,
1.67 nicm 660: .scope = OPTIONS_TABLE_WINDOW,
1.1 nicm 661: .choices = options_table_clock_mode_style_list,
662: .default_num = 1
1.124 nicm 663: },
664:
665: { .name = "copy-mode-match-style",
666: .type = OPTIONS_TABLE_STRING,
667: .scope = OPTIONS_TABLE_WINDOW,
668: .default_str = "bg=cyan,fg=black",
669: .flags = OPTIONS_TABLE_IS_STYLE,
670: .separator = ","
671: },
672:
673: { .name = "copy-mode-current-match-style",
674: .type = OPTIONS_TABLE_STRING,
675: .scope = OPTIONS_TABLE_WINDOW,
676: .default_str = "bg=magenta,fg=black",
677: .flags = OPTIONS_TABLE_IS_STYLE,
678: .separator = ","
1.1 nicm 679: },
680:
681: { .name = "main-pane-height",
1.120 nicm 682: .type = OPTIONS_TABLE_STRING,
1.67 nicm 683: .scope = OPTIONS_TABLE_WINDOW,
1.120 nicm 684: .default_str = "24"
1.1 nicm 685: },
686:
687: { .name = "main-pane-width",
1.120 nicm 688: .type = OPTIONS_TABLE_STRING,
1.67 nicm 689: .scope = OPTIONS_TABLE_WINDOW,
1.120 nicm 690: .default_str = "80"
1.1 nicm 691: },
692:
693: { .name = "mode-keys",
694: .type = OPTIONS_TABLE_CHOICE,
1.67 nicm 695: .scope = OPTIONS_TABLE_WINDOW,
1.1 nicm 696: .choices = options_table_mode_keys_list,
697: .default_num = MODEKEY_EMACS
698: },
699:
1.43 nicm 700: { .name = "mode-style",
1.123 nicm 701: .type = OPTIONS_TABLE_STRING,
1.67 nicm 702: .scope = OPTIONS_TABLE_WINDOW,
1.123 nicm 703: .default_str = "bg=yellow,fg=black",
704: .flags = OPTIONS_TABLE_IS_STYLE,
705: .separator = ","
1.43 nicm 706: },
707:
1.1 nicm 708: { .name = "monitor-activity",
709: .type = OPTIONS_TABLE_FLAG,
1.67 nicm 710: .scope = OPTIONS_TABLE_WINDOW,
1.1 nicm 711: .default_num = 0
1.93 nicm 712: },
713:
714: { .name = "monitor-bell",
715: .type = OPTIONS_TABLE_FLAG,
716: .scope = OPTIONS_TABLE_WINDOW,
717: .default_num = 1
1.1 nicm 718: },
719:
720: { .name = "monitor-silence",
721: .type = OPTIONS_TABLE_NUMBER,
1.67 nicm 722: .scope = OPTIONS_TABLE_WINDOW,
1.1 nicm 723: .minimum = 0,
724: .maximum = INT_MAX,
725: .default_num = 0
726: },
727:
728: { .name = "other-pane-height",
1.120 nicm 729: .type = OPTIONS_TABLE_STRING,
1.67 nicm 730: .scope = OPTIONS_TABLE_WINDOW,
1.120 nicm 731: .default_str = "0"
1.1 nicm 732: },
733:
734: { .name = "other-pane-width",
1.120 nicm 735: .type = OPTIONS_TABLE_STRING,
1.67 nicm 736: .scope = OPTIONS_TABLE_WINDOW,
1.120 nicm 737: .default_str = "0"
1.13 nicm 738: },
739:
1.53 nicm 740: { .name = "pane-active-border-style",
1.123 nicm 741: .type = OPTIONS_TABLE_STRING,
1.67 nicm 742: .scope = OPTIONS_TABLE_WINDOW,
1.123 nicm 743: .default_str = "#{?pane_in_mode,fg=yellow,#{?synchronize-panes,fg=red,fg=green}}",
744: .flags = OPTIONS_TABLE_IS_STYLE,
745: .separator = ","
1.53 nicm 746: },
747:
1.13 nicm 748: { .name = "pane-base-index",
749: .type = OPTIONS_TABLE_NUMBER,
1.67 nicm 750: .scope = OPTIONS_TABLE_WINDOW,
1.13 nicm 751: .minimum = 0,
752: .maximum = USHRT_MAX,
1.22 nicm 753: .default_num = 0
1.53 nicm 754: },
755:
1.72 nicm 756: { .name = "pane-border-format",
757: .type = OPTIONS_TABLE_STRING,
758: .scope = OPTIONS_TABLE_WINDOW,
1.73 nicm 759: .default_str = "#{?pane_active,#[reverse],}#{pane_index}#[default] "
1.87 nicm 760: "\"#{pane_title}\""
1.72 nicm 761: },
762:
763: { .name = "pane-border-status",
764: .type = OPTIONS_TABLE_CHOICE,
765: .scope = OPTIONS_TABLE_WINDOW,
766: .choices = options_table_pane_status_list,
1.109 nicm 767: .default_num = PANE_STATUS_OFF
1.53 nicm 768: },
769:
770: { .name = "pane-border-style",
1.123 nicm 771: .type = OPTIONS_TABLE_STRING,
1.67 nicm 772: .scope = OPTIONS_TABLE_WINDOW,
1.123 nicm 773: .default_str = "default",
774: .flags = OPTIONS_TABLE_IS_STYLE,
775: .separator = ","
1.22 nicm 776: },
777:
1.1 nicm 778: { .name = "remain-on-exit",
779: .type = OPTIONS_TABLE_FLAG,
1.107 nicm 780: .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
1.1 nicm 781: .default_num = 0
782: },
783:
784: { .name = "synchronize-panes",
785: .type = OPTIONS_TABLE_FLAG,
1.67 nicm 786: .scope = OPTIONS_TABLE_WINDOW,
1.1 nicm 787: .default_num = 0
1.54 nicm 788: },
789:
790: { .name = "window-active-style",
1.123 nicm 791: .type = OPTIONS_TABLE_STRING,
1.107 nicm 792: .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
1.123 nicm 793: .default_str = "default",
794: .flags = OPTIONS_TABLE_IS_STYLE,
795: .separator = ","
1.97 nicm 796: },
797:
798: { .name = "window-size",
799: .type = OPTIONS_TABLE_CHOICE,
800: .scope = OPTIONS_TABLE_WINDOW,
801: .choices = options_table_window_size_list,
1.113 nicm 802: .default_num = WINDOW_SIZE_LATEST
1.54 nicm 803: },
804:
805: { .name = "window-style",
1.123 nicm 806: .type = OPTIONS_TABLE_STRING,
1.107 nicm 807: .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
1.123 nicm 808: .default_str = "default",
809: .flags = OPTIONS_TABLE_IS_STYLE,
810: .separator = ","
1.1 nicm 811: },
812:
1.43 nicm 813: { .name = "window-status-activity-style",
1.123 nicm 814: .type = OPTIONS_TABLE_STRING,
1.67 nicm 815: .scope = OPTIONS_TABLE_WINDOW,
1.123 nicm 816: .default_str = "reverse",
817: .flags = OPTIONS_TABLE_IS_STYLE,
818: .separator = ","
1.43 nicm 819: },
820:
821: { .name = "window-status-bell-style",
1.123 nicm 822: .type = OPTIONS_TABLE_STRING,
1.67 nicm 823: .scope = OPTIONS_TABLE_WINDOW,
1.123 nicm 824: .default_str = "reverse",
825: .flags = OPTIONS_TABLE_IS_STYLE,
826: .separator = ","
1.43 nicm 827: },
828:
1.1 nicm 829: { .name = "window-status-current-format",
830: .type = OPTIONS_TABLE_STRING,
1.67 nicm 831: .scope = OPTIONS_TABLE_WINDOW,
1.57 nicm 832: .default_str = "#I:#W#{?window_flags,#{window_flags}, }"
1.30 nicm 833: },
834:
1.43 nicm 835: { .name = "window-status-current-style",
1.123 nicm 836: .type = OPTIONS_TABLE_STRING,
1.67 nicm 837: .scope = OPTIONS_TABLE_WINDOW,
1.123 nicm 838: .default_str = "default",
839: .flags = OPTIONS_TABLE_IS_STYLE,
840: .separator = ","
1.43 nicm 841: },
842:
843: { .name = "window-status-format",
844: .type = OPTIONS_TABLE_STRING,
1.67 nicm 845: .scope = OPTIONS_TABLE_WINDOW,
1.57 nicm 846: .default_str = "#I:#W#{?window_flags,#{window_flags}, }"
1.1 nicm 847: },
848:
1.43 nicm 849: { .name = "window-status-last-style",
1.123 nicm 850: .type = OPTIONS_TABLE_STRING,
1.67 nicm 851: .scope = OPTIONS_TABLE_WINDOW,
1.123 nicm 852: .default_str = "default",
853: .flags = OPTIONS_TABLE_IS_STYLE,
854: .separator = ","
1.1 nicm 855: },
856:
1.43 nicm 857: { .name = "window-status-separator",
1.1 nicm 858: .type = OPTIONS_TABLE_STRING,
1.67 nicm 859: .scope = OPTIONS_TABLE_WINDOW,
1.43 nicm 860: .default_str = " "
1.28 nicm 861: },
862:
1.43 nicm 863: { .name = "window-status-style",
1.123 nicm 864: .type = OPTIONS_TABLE_STRING,
1.67 nicm 865: .scope = OPTIONS_TABLE_WINDOW,
1.123 nicm 866: .default_str = "default",
867: .flags = OPTIONS_TABLE_IS_STYLE,
868: .separator = ","
1.24 nicm 869: },
870:
871: { .name = "wrap-search",
872: .type = OPTIONS_TABLE_FLAG,
1.67 nicm 873: .scope = OPTIONS_TABLE_WINDOW,
1.24 nicm 874: .default_num = 1
1.1 nicm 875: },
876:
877: { .name = "xterm-keys",
878: .type = OPTIONS_TABLE_FLAG,
1.67 nicm 879: .scope = OPTIONS_TABLE_WINDOW,
1.76 nicm 880: .default_num = 1
1.1 nicm 881: },
1.105 nicm 882:
883: /* Hook options. */
884: OPTIONS_TABLE_HOOK("after-bind-key", ""),
885: OPTIONS_TABLE_HOOK("after-capture-pane", ""),
886: OPTIONS_TABLE_HOOK("after-copy-mode", ""),
887: OPTIONS_TABLE_HOOK("after-display-message", ""),
888: OPTIONS_TABLE_HOOK("after-display-panes", ""),
1.115 nicm 889: OPTIONS_TABLE_HOOK("after-kill-pane", ""),
1.105 nicm 890: OPTIONS_TABLE_HOOK("after-list-buffers", ""),
891: OPTIONS_TABLE_HOOK("after-list-clients", ""),
892: OPTIONS_TABLE_HOOK("after-list-keys", ""),
893: OPTIONS_TABLE_HOOK("after-list-panes", ""),
894: OPTIONS_TABLE_HOOK("after-list-sessions", ""),
895: OPTIONS_TABLE_HOOK("after-list-windows", ""),
896: OPTIONS_TABLE_HOOK("after-load-buffer", ""),
897: OPTIONS_TABLE_HOOK("after-lock-server", ""),
898: OPTIONS_TABLE_HOOK("after-new-session", ""),
899: OPTIONS_TABLE_HOOK("after-new-window", ""),
900: OPTIONS_TABLE_HOOK("after-paste-buffer", ""),
901: OPTIONS_TABLE_HOOK("after-pipe-pane", ""),
902: OPTIONS_TABLE_HOOK("after-queue", ""),
903: OPTIONS_TABLE_HOOK("after-refresh-client", ""),
904: OPTIONS_TABLE_HOOK("after-rename-session", ""),
905: OPTIONS_TABLE_HOOK("after-rename-window", ""),
906: OPTIONS_TABLE_HOOK("after-resize-pane", ""),
907: OPTIONS_TABLE_HOOK("after-resize-window", ""),
908: OPTIONS_TABLE_HOOK("after-save-buffer", ""),
909: OPTIONS_TABLE_HOOK("after-select-layout", ""),
910: OPTIONS_TABLE_HOOK("after-select-pane", ""),
911: OPTIONS_TABLE_HOOK("after-select-window", ""),
912: OPTIONS_TABLE_HOOK("after-send-keys", ""),
913: OPTIONS_TABLE_HOOK("after-set-buffer", ""),
914: OPTIONS_TABLE_HOOK("after-set-environment", ""),
915: OPTIONS_TABLE_HOOK("after-set-hook", ""),
916: OPTIONS_TABLE_HOOK("after-set-option", ""),
917: OPTIONS_TABLE_HOOK("after-show-environment", ""),
918: OPTIONS_TABLE_HOOK("after-show-messages", ""),
919: OPTIONS_TABLE_HOOK("after-show-options", ""),
920: OPTIONS_TABLE_HOOK("after-split-window", ""),
921: OPTIONS_TABLE_HOOK("after-unbind-key", ""),
922: OPTIONS_TABLE_HOOK("alert-activity", ""),
923: OPTIONS_TABLE_HOOK("alert-bell", ""),
924: OPTIONS_TABLE_HOOK("alert-silence", ""),
925: OPTIONS_TABLE_HOOK("client-attached", ""),
926: OPTIONS_TABLE_HOOK("client-detached", ""),
927: OPTIONS_TABLE_HOOK("client-resized", ""),
928: OPTIONS_TABLE_HOOK("client-session-changed", ""),
1.116 nicm 929: OPTIONS_TABLE_PANE_HOOK("pane-died", ""),
930: OPTIONS_TABLE_PANE_HOOK("pane-exited", ""),
931: OPTIONS_TABLE_PANE_HOOK("pane-focus-in", ""),
932: OPTIONS_TABLE_PANE_HOOK("pane-focus-out", ""),
933: OPTIONS_TABLE_PANE_HOOK("pane-mode-changed", ""),
934: OPTIONS_TABLE_PANE_HOOK("pane-set-clipboard", ""),
1.105 nicm 935: OPTIONS_TABLE_HOOK("session-closed", ""),
936: OPTIONS_TABLE_HOOK("session-created", ""),
937: OPTIONS_TABLE_HOOK("session-renamed", ""),
938: OPTIONS_TABLE_HOOK("session-window-changed", ""),
1.116 nicm 939: OPTIONS_TABLE_WINDOW_HOOK("window-layout-changed", ""),
940: OPTIONS_TABLE_WINDOW_HOOK("window-linked", ""),
941: OPTIONS_TABLE_WINDOW_HOOK("window-pane-changed", ""),
942: OPTIONS_TABLE_WINDOW_HOOK("window-renamed", ""),
943: OPTIONS_TABLE_WINDOW_HOOK("window-unlinked", ""),
1.1 nicm 944:
945: { .name = NULL }
946: };