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

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