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