Add a way for control mode clients to subscribe to a format and be

notified of changes rather than having to poll. GitHub issue 2242.
This commit is contained in:
nicm
2020-07-06 09:14:20 +00:00
parent 2bf612a806
commit 66d5e5de7a
5 changed files with 509 additions and 13 deletions

12
tmux.h
View File

@ -1722,6 +1722,15 @@ struct client {
};
TAILQ_HEAD(clients, client);
/* Control mode subscription type. */
enum control_sub_type {
CONTROL_SUB_SESSION,
CONTROL_SUB_PANE,
CONTROL_SUB_ALL_PANES,
CONTROL_SUB_WINDOW,
CONTROL_SUB_ALL_WINDOWS
};
/* Key binding and key table. */
struct key_binding {
key_code key;
@ -2862,6 +2871,9 @@ void control_reset_offsets(struct client *);
void printflike(2, 3) control_write(struct client *, const char *, ...);
void control_write_output(struct client *, struct window_pane *);
int control_all_done(struct client *);
void control_add_sub(struct client *, const char *, enum control_sub_type,
int, const char *);
void control_remove_sub(struct client *, const char *);
/* control-notify.c */
void control_notify_input(struct client *, struct window_pane *,