diff options
Diffstat (limited to 'tmux.h')
-rw-r--r-- | tmux.h | 42 |
1 files changed, 40 insertions, 2 deletions
@@ -1293,6 +1293,20 @@ struct args { char **argv; }; +/* Context for a command about to be executed. */ +struct cmd_state_flag { + struct session *s; + struct winlink *wl; + struct window_pane *wp; + int idx; + +}; +struct cmd_state { + struct client *c; + struct cmd_state_flag tflag; + struct cmd_state_flag sflag; +}; + /* Command and list of commands. */ struct cmd { const struct cmd_entry *entry; @@ -1343,6 +1357,8 @@ struct cmd_q { struct cmd_q_item *item; struct cmd *cmd; + struct cmd_state state; + time_t time; u_int number; @@ -1365,10 +1381,31 @@ struct cmd_entry { #define CMD_STARTSERVER 0x1 #define CMD_READONLY 0x2 +#define CMD_SESSION_T 0x4 +#define CMD_SESSION_S 0x8 +#define CMD_WINDOW_T 0x10 +#define CMD_WINDOW_S 0x20 +#define CMD_PANE_T 0x40 +#define CMD_PANE_S 0x80 +#define CMD_CLIENT_T 0x100 +#define CMD_CLIENT_C 0x200 +#define CMD_INDEX_T 0x400 +#define CMD_INDEX_S 0x800 +#define CMD_CANFAIL 0x1000 +#define CMD_PREFERUNATTACHED 0x2000 +#define CMD_MOVEW_R 0x4000 /* for movew -r only */ +#define CMD_PANE_MARKED_S 0x8000 +#define CMD_PANE_MARKED_T 0x10000 +#define CMD_WINDOW_MARKED_T 0x20000 +#define CMD_WINDOW_MARKED_S 0x40000 int flags; enum cmd_retval (*exec)(struct cmd *, struct cmd_q *); }; +#define CMD_ALL_T (CMD_SESSION_T|CMD_WINDOW_T|CMD_PANE_T|CMD_INDEX_T| \ + CMD_MOVEW_R|CMD_PANE_MARKED_T|CMD_WINDOW_MARKED_T) +#define CMD_ALL_S (CMD_SESSION_S|CMD_WINDOW_S|CMD_PANE_S|CMD_INDEX_S| \ + CMD_PANE_MARKED_S|CMD_WINDOW_MARKED_S) /* Key binding and key table. */ struct key_binding { @@ -1718,6 +1755,7 @@ char **cmd_copy_argv(int, char **); void cmd_free_argv(int, char **); char *cmd_stringify_argv(int, char **); struct cmd *cmd_parse(int, char **, const char *, u_int, char **); +int cmd_prepare_state(struct cmd *, struct cmd_q *); char *cmd_print(struct cmd *); int cmd_mouse_at(struct window_pane *, struct mouse_event *, u_int *, u_int *, int); @@ -1728,8 +1766,8 @@ char *cmd_template_replace(const char *, const char *, int); extern const struct cmd_entry *cmd_table[]; /* cmd-attach-session.c */ -enum cmd_retval cmd_attach_session(struct cmd_q *, const char *, int, int, - const char *, int); +enum cmd_retval cmd_attach_session(struct cmd_q *, int, int, const char *, + int); /* cmd-list.c */ struct cmd_list *cmd_list_parse(int, char **, const char *, u_int, char **); |