[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.110

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