Make client -c and -t handling common in cmd-queue.c and try to be

clearer about whether the client is the target client (must have a
session) or not.
This commit is contained in:
nicm
2020-04-13 20:51:57 +00:00
parent 187277eaad
commit 3f7f9a0e20
29 changed files with 239 additions and 237 deletions

9
tmux.h
View File

@ -1413,6 +1413,9 @@ struct cmd_entry {
#define CMD_STARTSERVER 0x1
#define CMD_READONLY 0x2
#define CMD_AFTERHOOK 0x4
#define CMD_CLIENT_CFLAG 0x8
#define CMD_CLIENT_TFLAG 0x10
#define CMD_CLIENT_CANFAIL 0x20
int flags;
enum cmd_retval (*exec)(struct cmd *, struct cmdq_item *);
@ -1681,7 +1684,7 @@ struct spawn_context {
struct session *s;
struct winlink *wl;
struct client *c;
struct client *tc;
struct window_pane *wp0;
struct layout_cell *lc;
@ -1793,8 +1796,7 @@ char *format_expand(struct format_tree *, const char *);
char *format_single(struct cmdq_item *, const char *,
struct client *, struct session *, struct winlink *,
struct window_pane *);
char *format_single_from_target(struct cmdq_item *, const char *,
struct client *);
char *format_single_from_target(struct cmdq_item *, const char *);
void format_defaults(struct format_tree *, struct client *,
struct session *, struct winlink *, struct window_pane *);
void format_defaults_window(struct format_tree *, struct window *);
@ -2113,6 +2115,7 @@ struct cmdq_list *cmdq_new(void);
void cmdq_free(struct cmdq_list *);
const char *cmdq_get_name(struct cmdq_item *);
struct client *cmdq_get_client(struct cmdq_item *);
struct client *cmdq_get_target_client(struct cmdq_item *);
struct cmdq_state *cmdq_get_state(struct cmdq_item *);
struct cmd_find_state *cmdq_get_target(struct cmdq_item *);
struct cmd_find_state *cmdq_get_source(struct cmdq_item *);