Replication of bind/unbind commands

This commit is contained in:
Nicolas Viennot
2013-06-11 22:45:33 -04:00
parent 839c4e3dd9
commit 35daf6d805
5 changed files with 38 additions and 10 deletions

View File

@@ -1,5 +1,3 @@
#include <time.h>
#include "tmate.h"
static int msgpack_write(void *data, const char *buf, unsigned int len)
@@ -87,3 +85,28 @@ void tmate_pty_data(struct window_pane *wp, const char *buf, size_t len)
len -= to_write;
}
}
static const struct cmd_entry *replicated_cmds[] = {
&cmd_bind_key_entry,
&cmd_unbind_key_entry,
&cmd_set_option_entry,
&cmd_set_window_option_entry,
NULL
};
int tmate_should_replicate_cmd(const struct cmd_entry *cmd)
{
const struct cmd_entry **ptr;
for (ptr = replicated_cmds; *ptr; ptr++)
if (*ptr == cmd)
return 1;
return 0;
}
void tmate_cmd(const char *cmd)
{
pack(array, 2);
pack(int, TMATE_CMD);
pack(string, cmd);
}