=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/options-table.c,v retrieving revision 1.42 retrieving revision 1.43 diff -c -r1.42 -r1.43 *** src/usr.bin/tmux/options-table.c 2013/10/10 12:26:36 1.42 --- src/usr.bin/tmux/options-table.c 2014/01/28 23:07:09 1.43 *************** *** 1,4 **** ! /* $OpenBSD: options-table.c,v 1.42 2013/10/10 12:26:36 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: options-table.c,v 1.43 2014/01/28 23:07:09 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott *************** *** 196,227 **** { .name = "message-attr", .type = OPTIONS_TABLE_ATTRIBUTES, ! .default_num = 0 }, { .name = "message-bg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 3 }, { .name = "message-command-attr", .type = OPTIONS_TABLE_ATTRIBUTES, ! .default_num = 0 }, { .name = "message-command-bg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 0 }, { .name = "message-command-fg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 3 }, { .name = "message-fg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 0 }, { .name = "message-limit", --- 196,238 ---- { .name = "message-attr", .type = OPTIONS_TABLE_ATTRIBUTES, ! .default_num = 0, ! .style = "message-style" }, { .name = "message-bg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 3, ! .style = "message-style" }, { .name = "message-command-attr", .type = OPTIONS_TABLE_ATTRIBUTES, ! .default_num = 0, ! .style = "message-command-style" }, { .name = "message-command-bg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 0, ! .style = "message-command-style" }, { .name = "message-command-fg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 3, ! .style = "message-command-style" }, + { .name = "message-command-style", + .type = OPTIONS_TABLE_STYLE, + .default_str = "bg=black,fg=yellow" + }, + { .name = "message-fg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 0, ! .style = "message-style" }, { .name = "message-limit", *************** *** 231,236 **** --- 242,252 ---- .default_num = 20 }, + { .name = "message-style", + .type = OPTIONS_TABLE_STYLE, + .default_str = "bg=yellow,fg=black" + }, + { .name = "mouse-resize-pane", .type = OPTIONS_TABLE_FLAG, .default_num = 0 *************** *** 253,276 **** { .name = "pane-active-border-bg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8 }, { .name = "pane-active-border-fg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 2 }, { .name = "pane-border-bg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8 }, { .name = "pane-border-fg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8 }, { .name = "prefix", .type = OPTIONS_TABLE_KEY, .default_num = '\002', --- 269,306 ---- { .name = "pane-active-border-bg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8, ! .style = "pane-active-border-style" }, { .name = "pane-active-border-fg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 2, ! .style = "pane-active-border-style" }, + { .name = "pane-active-border-style", + .type = OPTIONS_TABLE_STYLE, + .default_str = "fg=green" + }, + { .name = "pane-border-bg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8, ! .style = "pane-border-style" }, { .name = "pane-border-fg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8, ! .style = "pane-border-style" }, + { .name = "pane-border-style", + .type = OPTIONS_TABLE_STYLE, + .default_str = "default" + }, + { .name = "prefix", .type = OPTIONS_TABLE_KEY, .default_num = '\002', *************** *** 315,331 **** { .name = "status-attr", .type = OPTIONS_TABLE_ATTRIBUTES, ! .default_num = 0 }, { .name = "status-bg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 2 }, { .name = "status-fg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 0 }, { .name = "status-interval", --- 345,364 ---- { .name = "status-attr", .type = OPTIONS_TABLE_ATTRIBUTES, ! .default_num = 0, ! .style = "status-style" }, { .name = "status-bg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 2, ! .style = "status-style" }, { .name = "status-fg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 0, ! .style = "status-style" }, { .name = "status-interval", *************** *** 354,370 **** { .name = "status-left-attr", .type = OPTIONS_TABLE_ATTRIBUTES, ! .default_num = 0 }, { .name = "status-left-bg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8 }, { .name = "status-left-fg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8 }, { .name = "status-left-length", --- 387,406 ---- { .name = "status-left-attr", .type = OPTIONS_TABLE_ATTRIBUTES, ! .default_num = 0, ! .style = "status-left-style" }, { .name = "status-left-bg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8, ! .style = "status-left-style" }, { .name = "status-left-fg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8, ! .style = "status-left-style" }, { .name = "status-left-length", *************** *** 374,379 **** --- 410,420 ---- .default_num = 10 }, + { .name = "status-left-style", + .type = OPTIONS_TABLE_STYLE, + .default_str = "default" + }, + { .name = "status-position", .type = OPTIONS_TABLE_CHOICE, .choices = options_table_status_position_list, *************** *** 387,403 **** { .name = "status-right-attr", .type = OPTIONS_TABLE_ATTRIBUTES, ! .default_num = 0 }, { .name = "status-right-bg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8 }, { .name = "status-right-fg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8 }, { .name = "status-right-length", --- 428,447 ---- { .name = "status-right-attr", .type = OPTIONS_TABLE_ATTRIBUTES, ! .default_num = 0, ! .style = "status-right-style" }, { .name = "status-right-bg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8, ! .style = "status-right-style" }, { .name = "status-right-fg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8, ! .style = "status-right-style" }, { .name = "status-right-length", *************** *** 407,412 **** --- 451,466 ---- .default_num = 40 }, + { .name = "status-right-style", + .type = OPTIONS_TABLE_STYLE, + .default_str = "default" + }, + + { .name = "status-style", + .type = OPTIONS_TABLE_STYLE, + .default_str = "bg=green,fg=black" + }, + { .name = "status-utf8", .type = OPTIONS_TABLE_FLAG, .default_num = 0 /* overridden in main() */ *************** *** 537,553 **** { .name = "mode-attr", .type = OPTIONS_TABLE_ATTRIBUTES, ! .default_num = 0 }, { .name = "mode-bg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 3 }, { .name = "mode-fg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 0 }, { .name = "mode-keys", --- 591,610 ---- { .name = "mode-attr", .type = OPTIONS_TABLE_ATTRIBUTES, ! .default_num = 0, ! .style = "mode-style" }, { .name = "mode-bg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 3, ! .style = "mode-style" }, { .name = "mode-fg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 0, ! .style = "mode-style" }, { .name = "mode-keys", *************** *** 562,567 **** --- 619,629 ---- .default_num = 0 }, + { .name = "mode-style", + .type = OPTIONS_TABLE_STYLE, + .default_str = "bg=yellow,fg=black" + }, + { .name = "monitor-activity", .type = OPTIONS_TABLE_FLAG, .default_num = 0 *************** *** 617,688 **** { .name = "window-status-activity-attr", .type = OPTIONS_TABLE_ATTRIBUTES, ! .default_num = GRID_ATTR_REVERSE }, { .name = "window-status-activity-bg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8 }, { .name = "window-status-activity-fg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8 }, { .name = "window-status-bell-attr", .type = OPTIONS_TABLE_ATTRIBUTES, ! .default_num = GRID_ATTR_REVERSE }, { .name = "window-status-bell-bg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8 }, { .name = "window-status-bell-fg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8 }, { .name = "window-status-content-attr", .type = OPTIONS_TABLE_ATTRIBUTES, ! .default_num = GRID_ATTR_REVERSE }, { .name = "window-status-content-bg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8 }, { .name = "window-status-content-fg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8 }, ! { .name = "window-status-attr", ! .type = OPTIONS_TABLE_ATTRIBUTES, ! .default_num = 0 }, - { .name = "window-status-bg", - .type = OPTIONS_TABLE_COLOUR, - .default_num = 8 - }, - { .name = "window-status-current-attr", .type = OPTIONS_TABLE_ATTRIBUTES, ! .default_num = 0 }, { .name = "window-status-current-bg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8 }, { .name = "window-status-current-fg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8 }, { .name = "window-status-current-format", --- 679,779 ---- { .name = "window-status-activity-attr", .type = OPTIONS_TABLE_ATTRIBUTES, ! .default_num = GRID_ATTR_REVERSE, ! .style = "window-status-activity-style" }, { .name = "window-status-activity-bg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8, ! .style = "window-status-activity-style" }, { .name = "window-status-activity-fg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8, ! .style = "window-status-activity-style" }, + { .name = "window-status-activity-style", + .type = OPTIONS_TABLE_STYLE, + .default_str = "reverse" + }, + + { .name = "window-status-attr", + .type = OPTIONS_TABLE_ATTRIBUTES, + .default_num = 0, + .style = "window-status-style" + }, + { .name = "window-status-bell-attr", .type = OPTIONS_TABLE_ATTRIBUTES, ! .default_num = GRID_ATTR_REVERSE, ! .style = "window-status-bell-style" }, { .name = "window-status-bell-bg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8, ! .style = "window-status-bell-style" }, { .name = "window-status-bell-fg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8, ! .style = "window-status-bell-style" }, + { .name = "window-status-bell-style", + .type = OPTIONS_TABLE_STYLE, + .default_str = "reverse" + }, + + { .name = "window-status-bg", + .type = OPTIONS_TABLE_COLOUR, + .default_num = 8, + .style = "window-status-style" + }, + { .name = "window-status-content-attr", .type = OPTIONS_TABLE_ATTRIBUTES, ! .default_num = GRID_ATTR_REVERSE, ! .style = "window-status-content-style" }, { .name = "window-status-content-bg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8, ! .style = "window-status-content-style" }, { .name = "window-status-content-fg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8, ! .style = "window-status-content-style" }, ! { .name = "window-status-content-style", ! .type = OPTIONS_TABLE_STYLE, ! .default_str = "reverse" }, { .name = "window-status-current-attr", .type = OPTIONS_TABLE_ATTRIBUTES, ! .default_num = 0, ! .style = "window-status-current-style" }, { .name = "window-status-current-bg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8, ! .style = "window-status-current-style" }, { .name = "window-status-current-fg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8, ! .style = "window-status-current-style" }, { .name = "window-status-current-format", *************** *** 690,725 **** .default_str = "#I:#W#F" }, { .name = "window-status-last-attr", .type = OPTIONS_TABLE_ATTRIBUTES, ! .default_num = 0 }, { .name = "window-status-last-bg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8 }, { .name = "window-status-last-fg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8 }, ! { .name = "window-status-fg", ! .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8 }, - { .name = "window-status-format", - .type = OPTIONS_TABLE_STRING, - .default_str = "#I:#W#F" - }, - { .name = "window-status-separator", .type = OPTIONS_TABLE_STRING, .default_str = " " }, { .name = "wrap-search", .type = OPTIONS_TABLE_FLAG, .default_num = 1 --- 781,835 ---- .default_str = "#I:#W#F" }, + { .name = "window-status-current-style", + .type = OPTIONS_TABLE_STYLE, + .default_str = "default" + }, + + { .name = "window-status-fg", + .type = OPTIONS_TABLE_COLOUR, + .default_num = 8, + .style = "window-status-style" + }, + + { .name = "window-status-format", + .type = OPTIONS_TABLE_STRING, + .default_str = "#I:#W#F" + }, + { .name = "window-status-last-attr", .type = OPTIONS_TABLE_ATTRIBUTES, ! .default_num = 0, ! .style = "window-status-last-style" }, { .name = "window-status-last-bg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8, ! .style = "window-status-last-style" }, { .name = "window-status-last-fg", .type = OPTIONS_TABLE_COLOUR, ! .default_num = 8, ! .style = "window-status-last-style" }, ! { .name = "window-status-last-style", ! .type = OPTIONS_TABLE_STYLE, ! .default_str = "default" }, { .name = "window-status-separator", .type = OPTIONS_TABLE_STRING, .default_str = " " }, + { .name = "window-status-style", + .type = OPTIONS_TABLE_STYLE, + .default_str = "default" + }, + { .name = "wrap-search", .type = OPTIONS_TABLE_FLAG, .default_num = 1 *************** *** 741,750 **** const struct options_table_entry *oe; for (oe = table; oe->name != NULL; oe++) { ! if (oe->default_str != NULL) options_set_string(oo, oe->name, "%s", oe->default_str); ! else options_set_number(oo, oe->name, oe->default_num); } } --- 851,867 ---- const struct options_table_entry *oe; for (oe = table; oe->name != NULL; oe++) { ! switch (oe->type) { ! case OPTIONS_TABLE_STRING: options_set_string(oo, oe->name, "%s", oe->default_str); ! break; ! case OPTIONS_TABLE_STYLE: ! options_set_style(oo, oe->name, oe->default_str); ! break; ! default: options_set_number(oo, oe->name, oe->default_num); + break; + } } } *************** *** 787,792 **** --- 904,913 ---- break; case OPTIONS_TABLE_CHOICE: s = oe->choices[o->num]; + xsnprintf(out, sizeof out, "%s", s); + break; + case OPTIONS_TABLE_STYLE: + s = style_tostring(&o->style); xsnprintf(out, sizeof out, "%s", s); break; }