Add set-hook -B install a subscription like in control mode.

Subscriptions are formats which are checked once a second and if changed
invoke a hook. show-hooks -B lists.
This commit is contained in:
nicm
2026-07-05 08:24:00 +00:00
parent 7a8f8f5a74
commit de024e04d7
9 changed files with 607 additions and 117 deletions

View File

@@ -702,7 +702,7 @@ control_start(struct client *c)
RB_INIT(&cs->panes);
TAILQ_INIT(&cs->pending_list);
TAILQ_INIT(&cs->all_blocks);
cs->subs = monitor_create(c, control_sub_change, NULL);
cs->subs = monitor_create_client(c, control_sub_change, NULL);
cs->read_event = bufferevent_new(c->fd, control_read_callback,
control_write_callback, control_error_callback, c);
@@ -776,7 +776,7 @@ control_add_sub(struct client *c, const char *name, enum monitor_type type,
{
struct control_state *cs = c->control_state;
monitor_add(cs->subs, name, type, id, format);
monitor_add(cs->subs, name, type, id, format, MONITOR_NOTIFY_INITIAL);
}
/* Remove a subscription. */