diff --git a/Makefile b/Makefile index f78b1615..9fa55d9b 100644 --- a/Makefile +++ b/Makefile @@ -77,6 +77,7 @@ SRCS= arguments.c \ cmd-switch-client.c \ cmd-unbind-key.c \ cmd-unlink-window.c \ + cmd-wait-for.c \ cmd.c \ cmd-queue.c \ colour.c \ diff --git a/cmd.c b/cmd.c index 5f530299..33ce730f 100644 --- a/cmd.c +++ b/cmd.c @@ -113,6 +113,7 @@ const struct cmd_entry *cmd_table[] = { &cmd_switch_client_entry, &cmd_unbind_key_entry, &cmd_unlink_window_entry, + &cmd_wait_for_entry, NULL }; @@ -327,9 +328,9 @@ cmd_current_session(struct cmd_q *cmdq, int prefer_unattached) return (c->session); /* - * If the name of the calling client's pty is know, build a list of the - * sessions that contain it and if any choose either the first or the - * newest. + * If the name of the calling client's pty is known, build a list of + * the sessions that contain it and if any choose either the first or + * the newest. */ path = c == NULL ? NULL : c->tty.path; if (path != NULL) { @@ -532,7 +533,7 @@ cmd_lookup_client(const char *name) for (i = 0; i < ARRAY_LENGTH(&clients); i++) { c = ARRAY_ITEM(&clients, i); - if (c == NULL || c->session == NULL) + if (c == NULL || c->session == NULL || c->tty.path == NULL) continue; path = c->tty.path; diff --git a/tmux.h b/tmux.h index eee1987f..0da2d0d3 100644 --- a/tmux.h +++ b/tmux.h @@ -1420,6 +1420,8 @@ struct cmd_q { void *data; struct msg_command_data *msgdata; + + TAILQ_ENTRY(cmd_q) waitentry; }; /* Command definition. */ @@ -1839,6 +1841,7 @@ extern const struct cmd_entry cmd_switch_client_entry; extern const struct cmd_entry cmd_unbind_key_entry; extern const struct cmd_entry cmd_unlink_window_entry; extern const struct cmd_entry cmd_up_pane_entry; +extern const struct cmd_entry cmd_wait_for_entry; /* cmd-attach-session.c */ enum cmd_retval cmd_attach_session(struct cmd_q *, const char*, int, int); @@ -2006,7 +2009,7 @@ void grid_clear_lines(struct grid *, u_int, u_int); void grid_move_lines(struct grid *, u_int, u_int, u_int); void grid_move_cells(struct grid *, u_int, u_int, u_int, u_int); char *grid_string_cells(struct grid *, u_int, u_int, u_int, - struct grid_cell **, int, int); + struct grid_cell **, int, int, int); void grid_duplicate_lines( struct grid *, u_int, struct grid *, u_int, u_int); u_int grid_reflow(struct grid *, struct grid *, u_int);