summaryrefslogtreecommitdiffstats
path: root/options-table.c
diff options
context:
space:
mode:
authornicm <nicm>2017-07-26 16:14:08 +0000
committernicm <nicm>2017-07-26 16:14:08 +0000
commit76887b1d27386b5418f953064d7e47389a6831be (patch)
treec0a5c8ad41f9cefdfcfeade15522cd57cba557cc /options-table.c
parent3bb426d92c482396fb7b1a8f8bc1c5ab525da1c6 (diff)
Make bell, activity and silence alerting more consistent:
- remove the bell-on-alert option; - add activity-action and silence-action options with the same possible values as the existing bell-action; - add "both" value for the visual-bell, visual-activity and visual-silence options to trigger both a bell and a message. This means all three work the same way. Based on changes from Yvain Thonnart.
Diffstat (limited to 'options-table.c')
-rw-r--r--options-table.c38
1 files changed, 26 insertions, 12 deletions
diff --git a/options-table.c b/options-table.c
index 91075871..7ad1c2f6 100644
--- a/options-table.c
+++ b/options-table.c
@@ -51,6 +51,9 @@ static const char *options_table_status_position_list[] = {
static const char *options_table_bell_action_list[] = {
"none", "any", "current", "other", NULL
};
+static const char *options_table_visual_bell_list[] = {
+ "off", "on", "both", NULL
+};
static const char *options_table_pane_status_list[] = {
"off", "top", "bottom", NULL
};
@@ -143,6 +146,13 @@ const struct options_table_entry options_table[] = {
.separator = ","
},
+ { .name = "activity-action",
+ .type = OPTIONS_TABLE_CHOICE,
+ .scope = OPTIONS_TABLE_SESSION,
+ .choices = options_table_bell_action_list,
+ .default_num = BELL_OTHER
+ },
+
{ .name = "assume-paste-time",
.type = OPTIONS_TABLE_NUMBER,
.scope = OPTIONS_TABLE_SESSION,
@@ -166,12 +176,6 @@ const struct options_table_entry options_table[] = {
.default_num = BELL_ANY
},
- { .name = "bell-on-alert",
- .type = OPTIONS_TABLE_FLAG,
- .scope = OPTIONS_TABLE_SESSION,
- .default_num = 0
- },
-
{ .name = "default-command",
.type = OPTIONS_TABLE_STRING,
.scope = OPTIONS_TABLE_SESSION,
@@ -350,6 +354,13 @@ const struct options_table_entry options_table[] = {
.default_str = "#S:#I:#W - \"#T\" #{session_alerts}"
},
+ { .name = "silence-action",
+ .type = OPTIONS_TABLE_CHOICE,
+ .scope = OPTIONS_TABLE_SESSION,
+ .choices = options_table_bell_action_list,
+ .default_num = BELL_OTHER
+ },
+
{ .name = "status",
.type = OPTIONS_TABLE_FLAG,
.scope = OPTIONS_TABLE_SESSION,
@@ -502,21 +513,24 @@ const struct options_table_entry options_table[] = {
},
{ .name = "visual-activity",
- .type = OPTIONS_TABLE_FLAG,
+ .type = OPTIONS_TABLE_CHOICE,
.scope = OPTIONS_TABLE_SESSION,
- .default_num = 0
+ .choices = options_table_visual_bell_list,
+ .default_num = VISUAL_OFF
},
{ .name = "visual-bell",
- .type = OPTIONS_TABLE_FLAG,
+ .type = OPTIONS_TABLE_CHOICE,
.scope = OPTIONS_TABLE_SESSION,
- .default_num = 0
+ .choices = options_table_visual_bell_list,
+ .default_num = VISUAL_OFF
},
{ .name = "visual-silence",
- .type = OPTIONS_TABLE_FLAG,
+ .type = OPTIONS_TABLE_CHOICE,
.scope = OPTIONS_TABLE_SESSION,
- .default_num = 0
+ .choices = options_table_visual_bell_list,
+ .default_num = VISUAL_OFF
},
{ .name = "word-separators",