[BACK]Return to options-table.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Annotation of src/usr.bin/tmux/options-table.c, Revision 1.114

1.114   ! nicm        1: /* $OpenBSD: options-table.c,v 1.113 2019/11/14 16:23:23 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.105     nicm      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:
1.80      nicm      153: /* Top-level options. */
1.67      nicm      154: const struct options_table_entry options_table[] = {
1.105     nicm      155:        /* Server options. */
1.112     nicm      156:        { .name = "backspace",
                    157:          .type = OPTIONS_TABLE_KEY,
                    158:          .scope = OPTIONS_TABLE_SERVER,
                    159:          .default_num = '\177',
                    160:        },
                    161:
1.1       nicm      162:        { .name = "buffer-limit",
                    163:          .type = OPTIONS_TABLE_NUMBER,
1.67      nicm      164:          .scope = OPTIONS_TABLE_SERVER,
1.1       nicm      165:          .minimum = 1,
                    166:          .maximum = INT_MAX,
1.88      nicm      167:          .default_num = 50
1.83      nicm      168:        },
                    169:
                    170:        { .name = "command-alias",
1.104     nicm      171:          .type = OPTIONS_TABLE_STRING,
1.83      nicm      172:          .scope = OPTIONS_TABLE_SERVER,
1.104     nicm      173:          .flags = OPTIONS_TABLE_IS_ARRAY,
1.83      nicm      174:          .default_str = "split-pane=split-window,"
1.84      nicm      175:                         "splitp=split-window,"
                    176:                         "server-info=show-messages -JT,"
1.88      nicm      177:                         "info=show-messages -JT,"
                    178:                         "choose-window=choose-tree -w,"
                    179:                         "choose-session=choose-tree -s",
1.84      nicm      180:          .separator = ","
1.81      nicm      181:        },
                    182:
1.56      nicm      183:        { .name = "default-terminal",
                    184:          .type = OPTIONS_TABLE_STRING,
1.67      nicm      185:          .scope = OPTIONS_TABLE_SERVER,
1.56      nicm      186:          .default_str = "screen"
                    187:        },
                    188:
1.1       nicm      189:        { .name = "escape-time",
                    190:          .type = OPTIONS_TABLE_NUMBER,
1.67      nicm      191:          .scope = OPTIONS_TABLE_SERVER,
1.1       nicm      192:          .minimum = 0,
                    193:          .maximum = INT_MAX,
                    194:          .default_num = 500
1.95      nicm      195:        },
                    196:
                    197:        { .name = "exit-empty",
                    198:          .type = OPTIONS_TABLE_FLAG,
                    199:          .scope = OPTIONS_TABLE_SERVER,
                    200:          .default_num = 1
1.1       nicm      201:        },
                    202:
                    203:        { .name = "exit-unattached",
1.38      nicm      204:          .type = OPTIONS_TABLE_FLAG,
1.67      nicm      205:          .scope = OPTIONS_TABLE_SERVER,
1.38      nicm      206:          .default_num = 0
                    207:        },
                    208:
                    209:        { .name = "focus-events",
1.1       nicm      210:          .type = OPTIONS_TABLE_FLAG,
1.67      nicm      211:          .scope = OPTIONS_TABLE_SERVER,
1.1       nicm      212:          .default_num = 0
1.61      nicm      213:        },
                    214:
                    215:        { .name = "history-file",
                    216:          .type = OPTIONS_TABLE_STRING,
1.67      nicm      217:          .scope = OPTIONS_TABLE_SERVER,
1.65      nicm      218:          .default_str = ""
1.1       nicm      219:        },
                    220:
1.46      nicm      221:        { .name = "message-limit",
                    222:          .type = OPTIONS_TABLE_NUMBER,
1.67      nicm      223:          .scope = OPTIONS_TABLE_SERVER,
1.46      nicm      224:          .minimum = 0,
                    225:          .maximum = INT_MAX,
                    226:          .default_num = 100
1.1       nicm      227:        },
                    228:
1.8       nicm      229:        { .name = "set-clipboard",
1.89      nicm      230:          .type = OPTIONS_TABLE_CHOICE,
1.67      nicm      231:          .scope = OPTIONS_TABLE_SERVER,
1.89      nicm      232:          .choices = options_table_set_clipboard_list,
1.8       nicm      233:          .default_num = 1
                    234:        },
                    235:
1.45      nicm      236:        { .name = "terminal-overrides",
1.104     nicm      237:          .type = OPTIONS_TABLE_STRING,
1.67      nicm      238:          .scope = OPTIONS_TABLE_SERVER,
1.104     nicm      239:          .flags = OPTIONS_TABLE_IS_ARRAY,
1.63      nicm      240:          .default_str = "xterm*:XT:Ms=\\E]52;%p1%s;%p2%s\\007"
1.87      nicm      241:                         ":Cs=\\E]12;%p1%s\\007:Cr=\\E]112\\007"
1.85      nicm      242:                         ":Ss=\\E[%p1%d q:Se=\\E[2 q,screen*:XT",
1.90      nicm      243:          .separator = ","
                    244:        },
                    245:
                    246:        { .name = "user-keys",
1.104     nicm      247:          .type = OPTIONS_TABLE_STRING,
1.90      nicm      248:          .scope = OPTIONS_TABLE_SERVER,
1.104     nicm      249:          .flags = OPTIONS_TABLE_IS_ARRAY,
1.90      nicm      250:          .default_str = "",
1.85      nicm      251:          .separator = ","
1.45      nicm      252:        },
                    253:
1.105     nicm      254:        /* Session options. */
1.91      nicm      255:        { .name = "activity-action",
                    256:          .type = OPTIONS_TABLE_CHOICE,
                    257:          .scope = OPTIONS_TABLE_SESSION,
                    258:          .choices = options_table_bell_action_list,
1.92      nicm      259:          .default_num = ALERT_OTHER
1.91      nicm      260:        },
                    261:
1.31      nicm      262:        { .name = "assume-paste-time",
                    263:          .type = OPTIONS_TABLE_NUMBER,
1.67      nicm      264:          .scope = OPTIONS_TABLE_SESSION,
1.31      nicm      265:          .minimum = 0,
                    266:          .maximum = INT_MAX,
                    267:          .default_num = 1,
                    268:        },
                    269:
1.1       nicm      270:        { .name = "base-index",
                    271:          .type = OPTIONS_TABLE_NUMBER,
1.67      nicm      272:          .scope = OPTIONS_TABLE_SESSION,
1.1       nicm      273:          .minimum = 0,
                    274:          .maximum = INT_MAX,
                    275:          .default_num = 0
                    276:        },
                    277:
                    278:        { .name = "bell-action",
                    279:          .type = OPTIONS_TABLE_CHOICE,
1.67      nicm      280:          .scope = OPTIONS_TABLE_SESSION,
1.1       nicm      281:          .choices = options_table_bell_action_list,
1.92      nicm      282:          .default_num = ALERT_ANY
1.11      nicm      283:        },
                    284:
1.1       nicm      285:        { .name = "default-command",
                    286:          .type = OPTIONS_TABLE_STRING,
1.67      nicm      287:          .scope = OPTIONS_TABLE_SESSION,
1.1       nicm      288:          .default_str = ""
                    289:        },
                    290:
                    291:        { .name = "default-shell",
                    292:          .type = OPTIONS_TABLE_STRING,
1.67      nicm      293:          .scope = OPTIONS_TABLE_SESSION,
1.1       nicm      294:          .default_str = _PATH_BSHELL
                    295:        },
                    296:
1.97      nicm      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:
1.1       nicm      304:        { .name = "destroy-unattached",
                    305:          .type = OPTIONS_TABLE_FLAG,
1.67      nicm      306:          .scope = OPTIONS_TABLE_SESSION,
1.1       nicm      307:          .default_num = 0
                    308:        },
                    309:
                    310:        { .name = "detach-on-destroy",
                    311:          .type = OPTIONS_TABLE_FLAG,
1.67      nicm      312:          .scope = OPTIONS_TABLE_SESSION,
1.1       nicm      313:          .default_num = 1
                    314:        },
                    315:
                    316:        { .name = "display-panes-active-colour",
                    317:          .type = OPTIONS_TABLE_COLOUR,
1.67      nicm      318:          .scope = OPTIONS_TABLE_SESSION,
1.1       nicm      319:          .default_num = 1
                    320:        },
                    321:
                    322:        { .name = "display-panes-colour",
                    323:          .type = OPTIONS_TABLE_COLOUR,
1.67      nicm      324:          .scope = OPTIONS_TABLE_SESSION,
1.1       nicm      325:          .default_num = 4
                    326:        },
                    327:
                    328:        { .name = "display-panes-time",
                    329:          .type = OPTIONS_TABLE_NUMBER,
1.67      nicm      330:          .scope = OPTIONS_TABLE_SESSION,
1.1       nicm      331:          .minimum = 1,
                    332:          .maximum = INT_MAX,
                    333:          .default_num = 1000
                    334:        },
                    335:
                    336:        { .name = "display-time",
                    337:          .type = OPTIONS_TABLE_NUMBER,
1.67      nicm      338:          .scope = OPTIONS_TABLE_SESSION,
1.68      tim       339:          .minimum = 0,
1.1       nicm      340:          .maximum = INT_MAX,
                    341:          .default_num = 750
                    342:        },
                    343:
                    344:        { .name = "history-limit",
                    345:          .type = OPTIONS_TABLE_NUMBER,
1.67      nicm      346:          .scope = OPTIONS_TABLE_SESSION,
1.1       nicm      347:          .minimum = 0,
1.3       nicm      348:          .maximum = INT_MAX,
1.1       nicm      349:          .default_num = 2000
1.70      nicm      350:        },
                    351:
                    352:        { .name = "key-table",
                    353:          .type = OPTIONS_TABLE_STRING,
                    354:          .scope = OPTIONS_TABLE_SESSION,
                    355:          .default_str = "root"
1.1       nicm      356:        },
                    357:
                    358:        { .name = "lock-after-time",
                    359:          .type = OPTIONS_TABLE_NUMBER,
1.67      nicm      360:          .scope = OPTIONS_TABLE_SESSION,
1.1       nicm      361:          .minimum = 0,
                    362:          .maximum = INT_MAX,
                    363:          .default_num = 0
                    364:        },
                    365:
                    366:        { .name = "lock-command",
                    367:          .type = OPTIONS_TABLE_STRING,
1.67      nicm      368:          .scope = OPTIONS_TABLE_SESSION,
1.1       nicm      369:          .default_str = "lock -np"
                    370:        },
                    371:
1.43      nicm      372:        { .name = "message-command-style",
                    373:          .type = OPTIONS_TABLE_STYLE,
1.67      nicm      374:          .scope = OPTIONS_TABLE_SESSION,
1.43      nicm      375:          .default_str = "bg=black,fg=yellow"
1.1       nicm      376:        },
                    377:
1.43      nicm      378:        { .name = "message-style",
                    379:          .type = OPTIONS_TABLE_STYLE,
1.67      nicm      380:          .scope = OPTIONS_TABLE_SESSION,
1.43      nicm      381:          .default_str = "bg=yellow,fg=black"
                    382:        },
                    383:
1.55      nicm      384:        { .name = "mouse",
1.1       nicm      385:          .type = OPTIONS_TABLE_FLAG,
1.67      nicm      386:          .scope = OPTIONS_TABLE_SESSION,
1.1       nicm      387:          .default_num = 0
                    388:        },
                    389:
                    390:        { .name = "prefix",
1.19      nicm      391:          .type = OPTIONS_TABLE_KEY,
1.67      nicm      392:          .scope = OPTIONS_TABLE_SESSION,
1.19      nicm      393:          .default_num = '\002',
                    394:        },
                    395:
                    396:        { .name = "prefix2",
                    397:          .type = OPTIONS_TABLE_KEY,
1.67      nicm      398:          .scope = OPTIONS_TABLE_SESSION,
1.19      nicm      399:          .default_num = KEYC_NONE,
1.29      nicm      400:        },
                    401:
                    402:        { .name = "renumber-windows",
                    403:          .type = OPTIONS_TABLE_FLAG,
1.67      nicm      404:          .scope = OPTIONS_TABLE_SESSION,
1.29      nicm      405:          .default_num = 0
1.1       nicm      406:        },
                    407:
                    408:        { .name = "repeat-time",
                    409:          .type = OPTIONS_TABLE_NUMBER,
1.67      nicm      410:          .scope = OPTIONS_TABLE_SESSION,
1.1       nicm      411:          .minimum = 0,
                    412:          .maximum = SHRT_MAX,
                    413:          .default_num = 500
                    414:        },
                    415:
                    416:        { .name = "set-titles",
                    417:          .type = OPTIONS_TABLE_FLAG,
1.67      nicm      418:          .scope = OPTIONS_TABLE_SESSION,
1.1       nicm      419:          .default_num = 0
                    420:        },
                    421:
                    422:        { .name = "set-titles-string",
                    423:          .type = OPTIONS_TABLE_STRING,
1.67      nicm      424:          .scope = OPTIONS_TABLE_SESSION,
1.60      nicm      425:          .default_str = "#S:#I:#W - \"#T\" #{session_alerts}"
1.1       nicm      426:        },
                    427:
1.91      nicm      428:        { .name = "silence-action",
                    429:          .type = OPTIONS_TABLE_CHOICE,
                    430:          .scope = OPTIONS_TABLE_SESSION,
                    431:          .choices = options_table_bell_action_list,
1.92      nicm      432:          .default_num = ALERT_OTHER
1.91      nicm      433:        },
                    434:
1.1       nicm      435:        { .name = "status",
1.99      nicm      436:          .type = OPTIONS_TABLE_CHOICE,
1.67      nicm      437:          .scope = OPTIONS_TABLE_SESSION,
1.99      nicm      438:          .choices = options_table_status_list,
1.1       nicm      439:          .default_num = 1
                    440:        },
                    441:
                    442:        { .name = "status-bg",
                    443:          .type = OPTIONS_TABLE_COLOUR,
1.67      nicm      444:          .scope = OPTIONS_TABLE_SESSION,
1.43      nicm      445:          .default_num = 2,
1.1       nicm      446:        },
                    447:
                    448:        { .name = "status-fg",
                    449:          .type = OPTIONS_TABLE_COLOUR,
1.67      nicm      450:          .scope = OPTIONS_TABLE_SESSION,
1.43      nicm      451:          .default_num = 0,
1.99      nicm      452:        },
                    453:
                    454:        { .name = "status-format",
1.104     nicm      455:          .type = OPTIONS_TABLE_STRING,
1.99      nicm      456:          .scope = OPTIONS_TABLE_SESSION,
1.104     nicm      457:          .flags = OPTIONS_TABLE_IS_ARRAY,
1.99      nicm      458:          .default_arr = options_table_status_format_default,
1.1       nicm      459:        },
                    460:
                    461:        { .name = "status-interval",
                    462:          .type = OPTIONS_TABLE_NUMBER,
1.67      nicm      463:          .scope = OPTIONS_TABLE_SESSION,
1.1       nicm      464:          .minimum = 0,
                    465:          .maximum = INT_MAX,
                    466:          .default_num = 15
                    467:        },
                    468:
                    469:        { .name = "status-justify",
                    470:          .type = OPTIONS_TABLE_CHOICE,
1.67      nicm      471:          .scope = OPTIONS_TABLE_SESSION,
1.1       nicm      472:          .choices = options_table_status_justify_list,
                    473:          .default_num = 0
                    474:        },
                    475:
                    476:        { .name = "status-keys",
                    477:          .type = OPTIONS_TABLE_CHOICE,
1.67      nicm      478:          .scope = OPTIONS_TABLE_SESSION,
1.1       nicm      479:          .choices = options_table_status_keys_list,
                    480:          .default_num = MODEKEY_EMACS
                    481:        },
                    482:
                    483:        { .name = "status-left",
                    484:          .type = OPTIONS_TABLE_STRING,
1.67      nicm      485:          .scope = OPTIONS_TABLE_SESSION,
1.51      nicm      486:          .default_str = "[#S] "
1.1       nicm      487:        },
                    488:
                    489:        { .name = "status-left-length",
                    490:          .type = OPTIONS_TABLE_NUMBER,
1.67      nicm      491:          .scope = OPTIONS_TABLE_SESSION,
1.1       nicm      492:          .minimum = 0,
                    493:          .maximum = SHRT_MAX,
                    494:          .default_num = 10
1.20      nicm      495:        },
                    496:
1.43      nicm      497:        { .name = "status-left-style",
                    498:          .type = OPTIONS_TABLE_STYLE,
1.67      nicm      499:          .scope = OPTIONS_TABLE_SESSION,
1.43      nicm      500:          .default_str = "default"
                    501:        },
                    502:
1.20      nicm      503:        { .name = "status-position",
                    504:          .type = OPTIONS_TABLE_CHOICE,
1.67      nicm      505:          .scope = OPTIONS_TABLE_SESSION,
1.20      nicm      506:          .choices = options_table_status_position_list,
                    507:          .default_num = 1
1.1       nicm      508:        },
                    509:
                    510:        { .name = "status-right",
                    511:          .type = OPTIONS_TABLE_STRING,
1.67      nicm      512:          .scope = OPTIONS_TABLE_SESSION,
1.97      nicm      513:          .default_str = "#{?window_bigger,"
                    514:                         "[#{window_offset_x}#,#{window_offset_y}] ,}"
                    515:                         "\"#{=21:pane_title}\" %H:%M %d-%b-%y"
1.1       nicm      516:        },
                    517:
                    518:        { .name = "status-right-length",
                    519:          .type = OPTIONS_TABLE_NUMBER,
1.67      nicm      520:          .scope = OPTIONS_TABLE_SESSION,
1.1       nicm      521:          .minimum = 0,
                    522:          .maximum = SHRT_MAX,
                    523:          .default_num = 40
                    524:        },
                    525:
1.43      nicm      526:        { .name = "status-right-style",
                    527:          .type = OPTIONS_TABLE_STYLE,
1.67      nicm      528:          .scope = OPTIONS_TABLE_SESSION,
1.43      nicm      529:          .default_str = "default"
                    530:        },
                    531:
                    532:        { .name = "status-style",
                    533:          .type = OPTIONS_TABLE_STYLE,
1.67      nicm      534:          .scope = OPTIONS_TABLE_SESSION,
1.43      nicm      535:          .default_str = "bg=green,fg=black"
                    536:        },
                    537:
1.1       nicm      538:        { .name = "update-environment",
1.104     nicm      539:          .type = OPTIONS_TABLE_STRING,
1.67      nicm      540:          .scope = OPTIONS_TABLE_SESSION,
1.104     nicm      541:          .flags = OPTIONS_TABLE_IS_ARRAY,
1.96      nicm      542:          .default_str = "DISPLAY KRB5CCNAME SSH_ASKPASS SSH_AUTH_SOCK "
                    543:                         "SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY"
1.1       nicm      544:        },
                    545:
                    546:        { .name = "visual-activity",
1.91      nicm      547:          .type = OPTIONS_TABLE_CHOICE,
1.67      nicm      548:          .scope = OPTIONS_TABLE_SESSION,
1.91      nicm      549:          .choices = options_table_visual_bell_list,
                    550:          .default_num = VISUAL_OFF
1.1       nicm      551:        },
                    552:
                    553:        { .name = "visual-bell",
1.91      nicm      554:          .type = OPTIONS_TABLE_CHOICE,
1.67      nicm      555:          .scope = OPTIONS_TABLE_SESSION,
1.91      nicm      556:          .choices = options_table_visual_bell_list,
                    557:          .default_num = VISUAL_OFF
1.1       nicm      558:        },
                    559:
                    560:        { .name = "visual-silence",
1.91      nicm      561:          .type = OPTIONS_TABLE_CHOICE,
1.67      nicm      562:          .scope = OPTIONS_TABLE_SESSION,
1.91      nicm      563:          .choices = options_table_visual_bell_list,
                    564:          .default_num = VISUAL_OFF
1.1       nicm      565:        },
                    566:
1.16      nicm      567:        { .name = "word-separators",
                    568:          .type = OPTIONS_TABLE_STRING,
1.67      nicm      569:          .scope = OPTIONS_TABLE_SESSION,
1.106     nicm      570:          .default_str = " "
1.16      nicm      571:        },
                    572:
1.105     nicm      573:        /* Window options. */
1.1       nicm      574:        { .name = "aggressive-resize",
                    575:          .type = OPTIONS_TABLE_FLAG,
1.67      nicm      576:          .scope = OPTIONS_TABLE_WINDOW,
1.1       nicm      577:          .default_num = 0
1.17      nicm      578:        },
                    579:
                    580:        { .name = "allow-rename",
                    581:          .type = OPTIONS_TABLE_FLAG,
1.108     nicm      582:          .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
1.94      nicm      583:          .default_num = 0
1.1       nicm      584:        },
                    585:
                    586:        { .name = "alternate-screen",
                    587:          .type = OPTIONS_TABLE_FLAG,
1.108     nicm      588:          .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
1.1       nicm      589:          .default_num = 1
                    590:        },
                    591:
                    592:        { .name = "automatic-rename",
                    593:          .type = OPTIONS_TABLE_FLAG,
1.67      nicm      594:          .scope = OPTIONS_TABLE_WINDOW,
1.1       nicm      595:          .default_num = 1
1.41      nicm      596:        },
                    597:
                    598:        { .name = "automatic-rename-format",
                    599:          .type = OPTIONS_TABLE_STRING,
1.67      nicm      600:          .scope = OPTIONS_TABLE_WINDOW,
1.50      nicm      601:          .default_str = "#{?pane_in_mode,[tmux],#{pane_current_command}}"
1.87      nicm      602:                         "#{?pane_dead,[dead],}"
1.1       nicm      603:        },
                    604:
                    605:        { .name = "clock-mode-colour",
                    606:          .type = OPTIONS_TABLE_COLOUR,
1.67      nicm      607:          .scope = OPTIONS_TABLE_WINDOW,
1.1       nicm      608:          .default_num = 4
                    609:        },
                    610:
                    611:        { .name = "clock-mode-style",
                    612:          .type = OPTIONS_TABLE_CHOICE,
1.67      nicm      613:          .scope = OPTIONS_TABLE_WINDOW,
1.1       nicm      614:          .choices = options_table_clock_mode_style_list,
                    615:          .default_num = 1
                    616:        },
                    617:
                    618:        { .name = "main-pane-height",
                    619:          .type = OPTIONS_TABLE_NUMBER,
1.67      nicm      620:          .scope = OPTIONS_TABLE_WINDOW,
1.1       nicm      621:          .minimum = 1,
                    622:          .maximum = INT_MAX,
                    623:          .default_num = 24
                    624:        },
                    625:
                    626:        { .name = "main-pane-width",
                    627:          .type = OPTIONS_TABLE_NUMBER,
1.67      nicm      628:          .scope = OPTIONS_TABLE_WINDOW,
1.1       nicm      629:          .minimum = 1,
                    630:          .maximum = INT_MAX,
                    631:          .default_num = 80
                    632:        },
                    633:
                    634:        { .name = "mode-keys",
                    635:          .type = OPTIONS_TABLE_CHOICE,
1.67      nicm      636:          .scope = OPTIONS_TABLE_WINDOW,
1.1       nicm      637:          .choices = options_table_mode_keys_list,
                    638:          .default_num = MODEKEY_EMACS
                    639:        },
                    640:
1.43      nicm      641:        { .name = "mode-style",
                    642:          .type = OPTIONS_TABLE_STYLE,
1.67      nicm      643:          .scope = OPTIONS_TABLE_WINDOW,
1.43      nicm      644:          .default_str = "bg=yellow,fg=black"
                    645:        },
                    646:
1.1       nicm      647:        { .name = "monitor-activity",
                    648:          .type = OPTIONS_TABLE_FLAG,
1.67      nicm      649:          .scope = OPTIONS_TABLE_WINDOW,
1.1       nicm      650:          .default_num = 0
1.93      nicm      651:        },
                    652:
                    653:        { .name = "monitor-bell",
                    654:          .type = OPTIONS_TABLE_FLAG,
                    655:          .scope = OPTIONS_TABLE_WINDOW,
                    656:          .default_num = 1
1.1       nicm      657:        },
                    658:
                    659:        { .name = "monitor-silence",
                    660:          .type = OPTIONS_TABLE_NUMBER,
1.67      nicm      661:          .scope = OPTIONS_TABLE_WINDOW,
1.1       nicm      662:          .minimum = 0,
                    663:          .maximum = INT_MAX,
                    664:          .default_num = 0
                    665:        },
                    666:
                    667:        { .name = "other-pane-height",
                    668:          .type = OPTIONS_TABLE_NUMBER,
1.67      nicm      669:          .scope = OPTIONS_TABLE_WINDOW,
1.1       nicm      670:          .minimum = 0,
                    671:          .maximum = INT_MAX,
                    672:          .default_num = 0
                    673:        },
                    674:
                    675:        { .name = "other-pane-width",
                    676:          .type = OPTIONS_TABLE_NUMBER,
1.67      nicm      677:          .scope = OPTIONS_TABLE_WINDOW,
1.1       nicm      678:          .minimum = 0,
                    679:          .maximum = INT_MAX,
1.13      nicm      680:          .default_num = 0
                    681:        },
                    682:
1.53      nicm      683:        { .name = "pane-active-border-style",
                    684:          .type = OPTIONS_TABLE_STYLE,
1.67      nicm      685:          .scope = OPTIONS_TABLE_WINDOW,
1.53      nicm      686:          .default_str = "fg=green"
                    687:        },
                    688:
1.13      nicm      689:        { .name = "pane-base-index",
                    690:          .type = OPTIONS_TABLE_NUMBER,
1.67      nicm      691:          .scope = OPTIONS_TABLE_WINDOW,
1.13      nicm      692:          .minimum = 0,
                    693:          .maximum = USHRT_MAX,
1.22      nicm      694:          .default_num = 0
1.53      nicm      695:        },
                    696:
1.72      nicm      697:        { .name = "pane-border-format",
                    698:          .type = OPTIONS_TABLE_STRING,
                    699:          .scope = OPTIONS_TABLE_WINDOW,
1.73      nicm      700:          .default_str = "#{?pane_active,#[reverse],}#{pane_index}#[default] "
1.87      nicm      701:                         "\"#{pane_title}\""
1.72      nicm      702:        },
                    703:
                    704:        { .name = "pane-border-status",
                    705:          .type = OPTIONS_TABLE_CHOICE,
                    706:          .scope = OPTIONS_TABLE_WINDOW,
                    707:          .choices = options_table_pane_status_list,
1.109     nicm      708:          .default_num = PANE_STATUS_OFF
1.53      nicm      709:        },
                    710:
                    711:        { .name = "pane-border-style",
                    712:          .type = OPTIONS_TABLE_STYLE,
1.67      nicm      713:          .scope = OPTIONS_TABLE_WINDOW,
1.53      nicm      714:          .default_str = "default"
1.22      nicm      715:        },
                    716:
1.1       nicm      717:        { .name = "remain-on-exit",
                    718:          .type = OPTIONS_TABLE_FLAG,
1.107     nicm      719:          .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
1.1       nicm      720:          .default_num = 0
                    721:        },
                    722:
                    723:        { .name = "synchronize-panes",
                    724:          .type = OPTIONS_TABLE_FLAG,
1.67      nicm      725:          .scope = OPTIONS_TABLE_WINDOW,
1.1       nicm      726:          .default_num = 0
1.54      nicm      727:        },
                    728:
                    729:        { .name = "window-active-style",
                    730:          .type = OPTIONS_TABLE_STYLE,
1.107     nicm      731:          .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
1.54      nicm      732:          .default_str = "default"
1.97      nicm      733:        },
                    734:
                    735:        { .name = "window-size",
                    736:          .type = OPTIONS_TABLE_CHOICE,
                    737:          .scope = OPTIONS_TABLE_WINDOW,
                    738:          .choices = options_table_window_size_list,
1.113     nicm      739:          .default_num = WINDOW_SIZE_LATEST
1.54      nicm      740:        },
                    741:
                    742:        { .name = "window-style",
                    743:          .type = OPTIONS_TABLE_STYLE,
1.107     nicm      744:          .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
1.54      nicm      745:          .default_str = "default"
1.1       nicm      746:        },
                    747:
1.43      nicm      748:        { .name = "window-status-activity-style",
                    749:          .type = OPTIONS_TABLE_STYLE,
1.67      nicm      750:          .scope = OPTIONS_TABLE_WINDOW,
1.43      nicm      751:          .default_str = "reverse"
                    752:        },
                    753:
                    754:        { .name = "window-status-bell-style",
                    755:          .type = OPTIONS_TABLE_STYLE,
1.67      nicm      756:          .scope = OPTIONS_TABLE_WINDOW,
1.43      nicm      757:          .default_str = "reverse"
                    758:        },
                    759:
1.1       nicm      760:        { .name = "window-status-current-format",
                    761:          .type = OPTIONS_TABLE_STRING,
1.67      nicm      762:          .scope = OPTIONS_TABLE_WINDOW,
1.57      nicm      763:          .default_str = "#I:#W#{?window_flags,#{window_flags}, }"
1.30      nicm      764:        },
                    765:
1.43      nicm      766:        { .name = "window-status-current-style",
                    767:          .type = OPTIONS_TABLE_STYLE,
1.67      nicm      768:          .scope = OPTIONS_TABLE_WINDOW,
1.43      nicm      769:          .default_str = "default"
                    770:        },
                    771:
                    772:        { .name = "window-status-format",
                    773:          .type = OPTIONS_TABLE_STRING,
1.67      nicm      774:          .scope = OPTIONS_TABLE_WINDOW,
1.57      nicm      775:          .default_str = "#I:#W#{?window_flags,#{window_flags}, }"
1.1       nicm      776:        },
                    777:
1.43      nicm      778:        { .name = "window-status-last-style",
                    779:          .type = OPTIONS_TABLE_STYLE,
1.67      nicm      780:          .scope = OPTIONS_TABLE_WINDOW,
1.43      nicm      781:          .default_str = "default"
1.1       nicm      782:        },
                    783:
1.43      nicm      784:        { .name = "window-status-separator",
1.1       nicm      785:          .type = OPTIONS_TABLE_STRING,
1.67      nicm      786:          .scope = OPTIONS_TABLE_WINDOW,
1.43      nicm      787:          .default_str = " "
1.28      nicm      788:        },
                    789:
1.43      nicm      790:        { .name = "window-status-style",
                    791:          .type = OPTIONS_TABLE_STYLE,
1.67      nicm      792:          .scope = OPTIONS_TABLE_WINDOW,
1.43      nicm      793:          .default_str = "default"
1.24      nicm      794:        },
                    795:
                    796:        { .name = "wrap-search",
                    797:          .type = OPTIONS_TABLE_FLAG,
1.67      nicm      798:          .scope = OPTIONS_TABLE_WINDOW,
1.24      nicm      799:          .default_num = 1
1.1       nicm      800:        },
                    801:
                    802:        { .name = "xterm-keys",
                    803:          .type = OPTIONS_TABLE_FLAG,
1.67      nicm      804:          .scope = OPTIONS_TABLE_WINDOW,
1.76      nicm      805:          .default_num = 1
1.1       nicm      806:        },
1.105     nicm      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", ""),
1.1       nicm      868:
                    869:        { .name = NULL }
                    870: };