Annotation of src/usr.bin/tmux/options-table.c, Revision 1.124
1.124 ! nicm 1: /* $OpenBSD: options-table.c,v 1.123 2020/05/16 15:01:31 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.122 nicm 264: .default_str = "",
1.118 nicm 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",
1.123 nicm 404: .type = OPTIONS_TABLE_STRING,
1.67 nicm 405: .scope = OPTIONS_TABLE_SESSION,
1.123 nicm 406: .default_str = "bg=black,fg=yellow",
407: .flags = OPTIONS_TABLE_IS_STYLE,
408: .separator = ","
1.1 nicm 409: },
410:
1.43 nicm 411: { .name = "message-style",
1.123 nicm 412: .type = OPTIONS_TABLE_STRING,
1.67 nicm 413: .scope = OPTIONS_TABLE_SESSION,
1.123 nicm 414: .default_str = "bg=yellow,fg=black",
415: .flags = OPTIONS_TABLE_IS_STYLE,
416: .separator = ","
1.43 nicm 417: },
418:
1.55 nicm 419: { .name = "mouse",
1.1 nicm 420: .type = OPTIONS_TABLE_FLAG,
1.67 nicm 421: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 422: .default_num = 0
423: },
424:
425: { .name = "prefix",
1.19 nicm 426: .type = OPTIONS_TABLE_KEY,
1.67 nicm 427: .scope = OPTIONS_TABLE_SESSION,
1.19 nicm 428: .default_num = '\002',
429: },
430:
431: { .name = "prefix2",
432: .type = OPTIONS_TABLE_KEY,
1.67 nicm 433: .scope = OPTIONS_TABLE_SESSION,
1.19 nicm 434: .default_num = KEYC_NONE,
1.29 nicm 435: },
436:
437: { .name = "renumber-windows",
438: .type = OPTIONS_TABLE_FLAG,
1.67 nicm 439: .scope = OPTIONS_TABLE_SESSION,
1.29 nicm 440: .default_num = 0
1.1 nicm 441: },
442:
443: { .name = "repeat-time",
444: .type = OPTIONS_TABLE_NUMBER,
1.67 nicm 445: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 446: .minimum = 0,
447: .maximum = SHRT_MAX,
448: .default_num = 500
449: },
450:
451: { .name = "set-titles",
452: .type = OPTIONS_TABLE_FLAG,
1.67 nicm 453: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 454: .default_num = 0
455: },
456:
457: { .name = "set-titles-string",
458: .type = OPTIONS_TABLE_STRING,
1.67 nicm 459: .scope = OPTIONS_TABLE_SESSION,
1.60 nicm 460: .default_str = "#S:#I:#W - \"#T\" #{session_alerts}"
1.1 nicm 461: },
462:
1.91 nicm 463: { .name = "silence-action",
464: .type = OPTIONS_TABLE_CHOICE,
465: .scope = OPTIONS_TABLE_SESSION,
466: .choices = options_table_bell_action_list,
1.92 nicm 467: .default_num = ALERT_OTHER
1.91 nicm 468: },
469:
1.1 nicm 470: { .name = "status",
1.99 nicm 471: .type = OPTIONS_TABLE_CHOICE,
1.67 nicm 472: .scope = OPTIONS_TABLE_SESSION,
1.99 nicm 473: .choices = options_table_status_list,
1.1 nicm 474: .default_num = 1
475: },
476:
477: { .name = "status-bg",
478: .type = OPTIONS_TABLE_COLOUR,
1.67 nicm 479: .scope = OPTIONS_TABLE_SESSION,
1.123 nicm 480: .default_num = 8,
1.1 nicm 481: },
482:
483: { .name = "status-fg",
484: .type = OPTIONS_TABLE_COLOUR,
1.67 nicm 485: .scope = OPTIONS_TABLE_SESSION,
1.123 nicm 486: .default_num = 8,
1.99 nicm 487: },
488:
489: { .name = "status-format",
1.104 nicm 490: .type = OPTIONS_TABLE_STRING,
1.99 nicm 491: .scope = OPTIONS_TABLE_SESSION,
1.104 nicm 492: .flags = OPTIONS_TABLE_IS_ARRAY,
1.99 nicm 493: .default_arr = options_table_status_format_default,
1.1 nicm 494: },
495:
496: { .name = "status-interval",
497: .type = OPTIONS_TABLE_NUMBER,
1.67 nicm 498: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 499: .minimum = 0,
500: .maximum = INT_MAX,
501: .default_num = 15
502: },
503:
504: { .name = "status-justify",
505: .type = OPTIONS_TABLE_CHOICE,
1.67 nicm 506: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 507: .choices = options_table_status_justify_list,
508: .default_num = 0
509: },
510:
511: { .name = "status-keys",
512: .type = OPTIONS_TABLE_CHOICE,
1.67 nicm 513: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 514: .choices = options_table_status_keys_list,
515: .default_num = MODEKEY_EMACS
516: },
517:
518: { .name = "status-left",
519: .type = OPTIONS_TABLE_STRING,
1.67 nicm 520: .scope = OPTIONS_TABLE_SESSION,
1.51 nicm 521: .default_str = "[#S] "
1.1 nicm 522: },
523:
524: { .name = "status-left-length",
525: .type = OPTIONS_TABLE_NUMBER,
1.67 nicm 526: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 527: .minimum = 0,
528: .maximum = SHRT_MAX,
529: .default_num = 10
1.20 nicm 530: },
531:
1.43 nicm 532: { .name = "status-left-style",
1.123 nicm 533: .type = OPTIONS_TABLE_STRING,
1.67 nicm 534: .scope = OPTIONS_TABLE_SESSION,
1.123 nicm 535: .default_str = "default",
536: .flags = OPTIONS_TABLE_IS_STYLE,
537: .separator = ","
1.43 nicm 538: },
539:
1.20 nicm 540: { .name = "status-position",
541: .type = OPTIONS_TABLE_CHOICE,
1.67 nicm 542: .scope = OPTIONS_TABLE_SESSION,
1.20 nicm 543: .choices = options_table_status_position_list,
544: .default_num = 1
1.1 nicm 545: },
546:
547: { .name = "status-right",
548: .type = OPTIONS_TABLE_STRING,
1.67 nicm 549: .scope = OPTIONS_TABLE_SESSION,
1.97 nicm 550: .default_str = "#{?window_bigger,"
551: "[#{window_offset_x}#,#{window_offset_y}] ,}"
552: "\"#{=21:pane_title}\" %H:%M %d-%b-%y"
1.1 nicm 553: },
554:
555: { .name = "status-right-length",
556: .type = OPTIONS_TABLE_NUMBER,
1.67 nicm 557: .scope = OPTIONS_TABLE_SESSION,
1.1 nicm 558: .minimum = 0,
559: .maximum = SHRT_MAX,
560: .default_num = 40
561: },
562:
1.43 nicm 563: { .name = "status-right-style",
1.123 nicm 564: .type = OPTIONS_TABLE_STRING,
1.67 nicm 565: .scope = OPTIONS_TABLE_SESSION,
1.123 nicm 566: .default_str = "default",
567: .flags = OPTIONS_TABLE_IS_STYLE,
568: .separator = ","
1.43 nicm 569: },
570:
571: { .name = "status-style",
1.123 nicm 572: .type = OPTIONS_TABLE_STRING,
1.67 nicm 573: .scope = OPTIONS_TABLE_SESSION,
1.123 nicm 574: .default_str = "bg=green,fg=black",
575: .flags = OPTIONS_TABLE_IS_STYLE,
576: .separator = ","
1.43 nicm 577: },
578:
1.1 nicm 579: { .name = "update-environment",
1.104 nicm 580: .type = OPTIONS_TABLE_STRING,
1.67 nicm 581: .scope = OPTIONS_TABLE_SESSION,
1.104 nicm 582: .flags = OPTIONS_TABLE_IS_ARRAY,
1.96 nicm 583: .default_str = "DISPLAY KRB5CCNAME SSH_ASKPASS SSH_AUTH_SOCK "
584: "SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY"
1.1 nicm 585: },
586:
587: { .name = "visual-activity",
1.91 nicm 588: .type = OPTIONS_TABLE_CHOICE,
1.67 nicm 589: .scope = OPTIONS_TABLE_SESSION,
1.91 nicm 590: .choices = options_table_visual_bell_list,
591: .default_num = VISUAL_OFF
1.1 nicm 592: },
593:
594: { .name = "visual-bell",
1.91 nicm 595: .type = OPTIONS_TABLE_CHOICE,
1.67 nicm 596: .scope = OPTIONS_TABLE_SESSION,
1.91 nicm 597: .choices = options_table_visual_bell_list,
598: .default_num = VISUAL_OFF
1.1 nicm 599: },
600:
601: { .name = "visual-silence",
1.91 nicm 602: .type = OPTIONS_TABLE_CHOICE,
1.67 nicm 603: .scope = OPTIONS_TABLE_SESSION,
1.91 nicm 604: .choices = options_table_visual_bell_list,
605: .default_num = VISUAL_OFF
1.1 nicm 606: },
607:
1.16 nicm 608: { .name = "word-separators",
609: .type = OPTIONS_TABLE_STRING,
1.67 nicm 610: .scope = OPTIONS_TABLE_SESSION,
1.106 nicm 611: .default_str = " "
1.16 nicm 612: },
613:
1.105 nicm 614: /* Window options. */
1.1 nicm 615: { .name = "aggressive-resize",
616: .type = OPTIONS_TABLE_FLAG,
1.67 nicm 617: .scope = OPTIONS_TABLE_WINDOW,
1.1 nicm 618: .default_num = 0
1.17 nicm 619: },
620:
621: { .name = "allow-rename",
622: .type = OPTIONS_TABLE_FLAG,
1.108 nicm 623: .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
1.94 nicm 624: .default_num = 0
1.1 nicm 625: },
626:
627: { .name = "alternate-screen",
628: .type = OPTIONS_TABLE_FLAG,
1.108 nicm 629: .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
1.1 nicm 630: .default_num = 1
631: },
632:
633: { .name = "automatic-rename",
634: .type = OPTIONS_TABLE_FLAG,
1.67 nicm 635: .scope = OPTIONS_TABLE_WINDOW,
1.1 nicm 636: .default_num = 1
1.41 nicm 637: },
638:
639: { .name = "automatic-rename-format",
640: .type = OPTIONS_TABLE_STRING,
1.67 nicm 641: .scope = OPTIONS_TABLE_WINDOW,
1.50 nicm 642: .default_str = "#{?pane_in_mode,[tmux],#{pane_current_command}}"
1.87 nicm 643: "#{?pane_dead,[dead],}"
1.1 nicm 644: },
645:
646: { .name = "clock-mode-colour",
647: .type = OPTIONS_TABLE_COLOUR,
1.67 nicm 648: .scope = OPTIONS_TABLE_WINDOW,
1.1 nicm 649: .default_num = 4
650: },
651:
652: { .name = "clock-mode-style",
653: .type = OPTIONS_TABLE_CHOICE,
1.67 nicm 654: .scope = OPTIONS_TABLE_WINDOW,
1.1 nicm 655: .choices = options_table_clock_mode_style_list,
656: .default_num = 1
1.124 ! nicm 657: },
! 658:
! 659: { .name = "copy-mode-match-style",
! 660: .type = OPTIONS_TABLE_STRING,
! 661: .scope = OPTIONS_TABLE_WINDOW,
! 662: .default_str = "bg=cyan,fg=black",
! 663: .flags = OPTIONS_TABLE_IS_STYLE,
! 664: .separator = ","
! 665: },
! 666:
! 667: { .name = "copy-mode-current-match-style",
! 668: .type = OPTIONS_TABLE_STRING,
! 669: .scope = OPTIONS_TABLE_WINDOW,
! 670: .default_str = "bg=magenta,fg=black",
! 671: .flags = OPTIONS_TABLE_IS_STYLE,
! 672: .separator = ","
1.1 nicm 673: },
674:
675: { .name = "main-pane-height",
1.120 nicm 676: .type = OPTIONS_TABLE_STRING,
1.67 nicm 677: .scope = OPTIONS_TABLE_WINDOW,
1.120 nicm 678: .default_str = "24"
1.1 nicm 679: },
680:
681: { .name = "main-pane-width",
1.120 nicm 682: .type = OPTIONS_TABLE_STRING,
1.67 nicm 683: .scope = OPTIONS_TABLE_WINDOW,
1.120 nicm 684: .default_str = "80"
1.1 nicm 685: },
686:
687: { .name = "mode-keys",
688: .type = OPTIONS_TABLE_CHOICE,
1.67 nicm 689: .scope = OPTIONS_TABLE_WINDOW,
1.1 nicm 690: .choices = options_table_mode_keys_list,
691: .default_num = MODEKEY_EMACS
692: },
693:
1.43 nicm 694: { .name = "mode-style",
1.123 nicm 695: .type = OPTIONS_TABLE_STRING,
1.67 nicm 696: .scope = OPTIONS_TABLE_WINDOW,
1.123 nicm 697: .default_str = "bg=yellow,fg=black",
698: .flags = OPTIONS_TABLE_IS_STYLE,
699: .separator = ","
1.43 nicm 700: },
701:
1.1 nicm 702: { .name = "monitor-activity",
703: .type = OPTIONS_TABLE_FLAG,
1.67 nicm 704: .scope = OPTIONS_TABLE_WINDOW,
1.1 nicm 705: .default_num = 0
1.93 nicm 706: },
707:
708: { .name = "monitor-bell",
709: .type = OPTIONS_TABLE_FLAG,
710: .scope = OPTIONS_TABLE_WINDOW,
711: .default_num = 1
1.1 nicm 712: },
713:
714: { .name = "monitor-silence",
715: .type = OPTIONS_TABLE_NUMBER,
1.67 nicm 716: .scope = OPTIONS_TABLE_WINDOW,
1.1 nicm 717: .minimum = 0,
718: .maximum = INT_MAX,
719: .default_num = 0
720: },
721:
722: { .name = "other-pane-height",
1.120 nicm 723: .type = OPTIONS_TABLE_STRING,
1.67 nicm 724: .scope = OPTIONS_TABLE_WINDOW,
1.120 nicm 725: .default_str = "0"
1.1 nicm 726: },
727:
728: { .name = "other-pane-width",
1.120 nicm 729: .type = OPTIONS_TABLE_STRING,
1.67 nicm 730: .scope = OPTIONS_TABLE_WINDOW,
1.120 nicm 731: .default_str = "0"
1.13 nicm 732: },
733:
1.53 nicm 734: { .name = "pane-active-border-style",
1.123 nicm 735: .type = OPTIONS_TABLE_STRING,
1.67 nicm 736: .scope = OPTIONS_TABLE_WINDOW,
1.123 nicm 737: .default_str = "#{?pane_in_mode,fg=yellow,#{?synchronize-panes,fg=red,fg=green}}",
738: .flags = OPTIONS_TABLE_IS_STYLE,
739: .separator = ","
1.53 nicm 740: },
741:
1.13 nicm 742: { .name = "pane-base-index",
743: .type = OPTIONS_TABLE_NUMBER,
1.67 nicm 744: .scope = OPTIONS_TABLE_WINDOW,
1.13 nicm 745: .minimum = 0,
746: .maximum = USHRT_MAX,
1.22 nicm 747: .default_num = 0
1.53 nicm 748: },
749:
1.72 nicm 750: { .name = "pane-border-format",
751: .type = OPTIONS_TABLE_STRING,
752: .scope = OPTIONS_TABLE_WINDOW,
1.73 nicm 753: .default_str = "#{?pane_active,#[reverse],}#{pane_index}#[default] "
1.87 nicm 754: "\"#{pane_title}\""
1.72 nicm 755: },
756:
757: { .name = "pane-border-status",
758: .type = OPTIONS_TABLE_CHOICE,
759: .scope = OPTIONS_TABLE_WINDOW,
760: .choices = options_table_pane_status_list,
1.109 nicm 761: .default_num = PANE_STATUS_OFF
1.53 nicm 762: },
763:
764: { .name = "pane-border-style",
1.123 nicm 765: .type = OPTIONS_TABLE_STRING,
1.67 nicm 766: .scope = OPTIONS_TABLE_WINDOW,
1.123 nicm 767: .default_str = "default",
768: .flags = OPTIONS_TABLE_IS_STYLE,
769: .separator = ","
1.22 nicm 770: },
771:
1.1 nicm 772: { .name = "remain-on-exit",
773: .type = OPTIONS_TABLE_FLAG,
1.107 nicm 774: .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
1.1 nicm 775: .default_num = 0
776: },
777:
778: { .name = "synchronize-panes",
779: .type = OPTIONS_TABLE_FLAG,
1.67 nicm 780: .scope = OPTIONS_TABLE_WINDOW,
1.1 nicm 781: .default_num = 0
1.54 nicm 782: },
783:
784: { .name = "window-active-style",
1.123 nicm 785: .type = OPTIONS_TABLE_STRING,
1.107 nicm 786: .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
1.123 nicm 787: .default_str = "default",
788: .flags = OPTIONS_TABLE_IS_STYLE,
789: .separator = ","
1.97 nicm 790: },
791:
792: { .name = "window-size",
793: .type = OPTIONS_TABLE_CHOICE,
794: .scope = OPTIONS_TABLE_WINDOW,
795: .choices = options_table_window_size_list,
1.113 nicm 796: .default_num = WINDOW_SIZE_LATEST
1.54 nicm 797: },
798:
799: { .name = "window-style",
1.123 nicm 800: .type = OPTIONS_TABLE_STRING,
1.107 nicm 801: .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
1.123 nicm 802: .default_str = "default",
803: .flags = OPTIONS_TABLE_IS_STYLE,
804: .separator = ","
1.1 nicm 805: },
806:
1.43 nicm 807: { .name = "window-status-activity-style",
1.123 nicm 808: .type = OPTIONS_TABLE_STRING,
1.67 nicm 809: .scope = OPTIONS_TABLE_WINDOW,
1.123 nicm 810: .default_str = "reverse",
811: .flags = OPTIONS_TABLE_IS_STYLE,
812: .separator = ","
1.43 nicm 813: },
814:
815: { .name = "window-status-bell-style",
1.123 nicm 816: .type = OPTIONS_TABLE_STRING,
1.67 nicm 817: .scope = OPTIONS_TABLE_WINDOW,
1.123 nicm 818: .default_str = "reverse",
819: .flags = OPTIONS_TABLE_IS_STYLE,
820: .separator = ","
1.43 nicm 821: },
822:
1.1 nicm 823: { .name = "window-status-current-format",
824: .type = OPTIONS_TABLE_STRING,
1.67 nicm 825: .scope = OPTIONS_TABLE_WINDOW,
1.57 nicm 826: .default_str = "#I:#W#{?window_flags,#{window_flags}, }"
1.30 nicm 827: },
828:
1.43 nicm 829: { .name = "window-status-current-style",
1.123 nicm 830: .type = OPTIONS_TABLE_STRING,
1.67 nicm 831: .scope = OPTIONS_TABLE_WINDOW,
1.123 nicm 832: .default_str = "default",
833: .flags = OPTIONS_TABLE_IS_STYLE,
834: .separator = ","
1.43 nicm 835: },
836:
837: { .name = "window-status-format",
838: .type = OPTIONS_TABLE_STRING,
1.67 nicm 839: .scope = OPTIONS_TABLE_WINDOW,
1.57 nicm 840: .default_str = "#I:#W#{?window_flags,#{window_flags}, }"
1.1 nicm 841: },
842:
1.43 nicm 843: { .name = "window-status-last-style",
1.123 nicm 844: .type = OPTIONS_TABLE_STRING,
1.67 nicm 845: .scope = OPTIONS_TABLE_WINDOW,
1.123 nicm 846: .default_str = "default",
847: .flags = OPTIONS_TABLE_IS_STYLE,
848: .separator = ","
1.1 nicm 849: },
850:
1.43 nicm 851: { .name = "window-status-separator",
1.1 nicm 852: .type = OPTIONS_TABLE_STRING,
1.67 nicm 853: .scope = OPTIONS_TABLE_WINDOW,
1.43 nicm 854: .default_str = " "
1.28 nicm 855: },
856:
1.43 nicm 857: { .name = "window-status-style",
1.123 nicm 858: .type = OPTIONS_TABLE_STRING,
1.67 nicm 859: .scope = OPTIONS_TABLE_WINDOW,
1.123 nicm 860: .default_str = "default",
861: .flags = OPTIONS_TABLE_IS_STYLE,
862: .separator = ","
1.24 nicm 863: },
864:
865: { .name = "wrap-search",
866: .type = OPTIONS_TABLE_FLAG,
1.67 nicm 867: .scope = OPTIONS_TABLE_WINDOW,
1.24 nicm 868: .default_num = 1
1.1 nicm 869: },
870:
871: { .name = "xterm-keys",
872: .type = OPTIONS_TABLE_FLAG,
1.67 nicm 873: .scope = OPTIONS_TABLE_WINDOW,
1.76 nicm 874: .default_num = 1
1.1 nicm 875: },
1.105 nicm 876:
877: /* Hook options. */
878: OPTIONS_TABLE_HOOK("after-bind-key", ""),
879: OPTIONS_TABLE_HOOK("after-capture-pane", ""),
880: OPTIONS_TABLE_HOOK("after-copy-mode", ""),
881: OPTIONS_TABLE_HOOK("after-display-message", ""),
882: OPTIONS_TABLE_HOOK("after-display-panes", ""),
1.115 nicm 883: OPTIONS_TABLE_HOOK("after-kill-pane", ""),
1.105 nicm 884: OPTIONS_TABLE_HOOK("after-list-buffers", ""),
885: OPTIONS_TABLE_HOOK("after-list-clients", ""),
886: OPTIONS_TABLE_HOOK("after-list-keys", ""),
887: OPTIONS_TABLE_HOOK("after-list-panes", ""),
888: OPTIONS_TABLE_HOOK("after-list-sessions", ""),
889: OPTIONS_TABLE_HOOK("after-list-windows", ""),
890: OPTIONS_TABLE_HOOK("after-load-buffer", ""),
891: OPTIONS_TABLE_HOOK("after-lock-server", ""),
892: OPTIONS_TABLE_HOOK("after-new-session", ""),
893: OPTIONS_TABLE_HOOK("after-new-window", ""),
894: OPTIONS_TABLE_HOOK("after-paste-buffer", ""),
895: OPTIONS_TABLE_HOOK("after-pipe-pane", ""),
896: OPTIONS_TABLE_HOOK("after-queue", ""),
897: OPTIONS_TABLE_HOOK("after-refresh-client", ""),
898: OPTIONS_TABLE_HOOK("after-rename-session", ""),
899: OPTIONS_TABLE_HOOK("after-rename-window", ""),
900: OPTIONS_TABLE_HOOK("after-resize-pane", ""),
901: OPTIONS_TABLE_HOOK("after-resize-window", ""),
902: OPTIONS_TABLE_HOOK("after-save-buffer", ""),
903: OPTIONS_TABLE_HOOK("after-select-layout", ""),
904: OPTIONS_TABLE_HOOK("after-select-pane", ""),
905: OPTIONS_TABLE_HOOK("after-select-window", ""),
906: OPTIONS_TABLE_HOOK("after-send-keys", ""),
907: OPTIONS_TABLE_HOOK("after-set-buffer", ""),
908: OPTIONS_TABLE_HOOK("after-set-environment", ""),
909: OPTIONS_TABLE_HOOK("after-set-hook", ""),
910: OPTIONS_TABLE_HOOK("after-set-option", ""),
911: OPTIONS_TABLE_HOOK("after-show-environment", ""),
912: OPTIONS_TABLE_HOOK("after-show-messages", ""),
913: OPTIONS_TABLE_HOOK("after-show-options", ""),
914: OPTIONS_TABLE_HOOK("after-split-window", ""),
915: OPTIONS_TABLE_HOOK("after-unbind-key", ""),
916: OPTIONS_TABLE_HOOK("alert-activity", ""),
917: OPTIONS_TABLE_HOOK("alert-bell", ""),
918: OPTIONS_TABLE_HOOK("alert-silence", ""),
919: OPTIONS_TABLE_HOOK("client-attached", ""),
920: OPTIONS_TABLE_HOOK("client-detached", ""),
921: OPTIONS_TABLE_HOOK("client-resized", ""),
922: OPTIONS_TABLE_HOOK("client-session-changed", ""),
1.116 nicm 923: OPTIONS_TABLE_PANE_HOOK("pane-died", ""),
924: OPTIONS_TABLE_PANE_HOOK("pane-exited", ""),
925: OPTIONS_TABLE_PANE_HOOK("pane-focus-in", ""),
926: OPTIONS_TABLE_PANE_HOOK("pane-focus-out", ""),
927: OPTIONS_TABLE_PANE_HOOK("pane-mode-changed", ""),
928: OPTIONS_TABLE_PANE_HOOK("pane-set-clipboard", ""),
1.105 nicm 929: OPTIONS_TABLE_HOOK("session-closed", ""),
930: OPTIONS_TABLE_HOOK("session-created", ""),
931: OPTIONS_TABLE_HOOK("session-renamed", ""),
932: OPTIONS_TABLE_HOOK("session-window-changed", ""),
1.116 nicm 933: OPTIONS_TABLE_WINDOW_HOOK("window-layout-changed", ""),
934: OPTIONS_TABLE_WINDOW_HOOK("window-linked", ""),
935: OPTIONS_TABLE_WINDOW_HOOK("window-pane-changed", ""),
936: OPTIONS_TABLE_WINDOW_HOOK("window-renamed", ""),
937: OPTIONS_TABLE_WINDOW_HOOK("window-unlinked", ""),
1.1 nicm 938:
939: { .name = NULL }
940: };