From 04cdd035250b93b728678d515b69690653dced4e Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 13 Apr 2020 10:59:58 +0000 Subject: Also move cmdq_item and cmdq_list into cmd-queue.c (this is to make its use more clearly defined and preparation for some future work). --- cmd-run-shell.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'cmd-run-shell.c') diff --git a/cmd-run-shell.c b/cmd-run-shell.c index b828576a..3c82ffdb 100644 --- a/cmd-run-shell.c +++ b/cmd-run-shell.c @@ -90,11 +90,11 @@ static enum cmd_retval cmd_run_shell_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = cmd_get_args(self); + struct cmd_find_state *target = cmdq_get_target(item); struct cmd_run_shell_data *cdata; struct client *c = cmd_find_client(item, NULL, 1); - struct session *s = item->target.s; - struct winlink *wl = item->target.wl; - struct window_pane *wp = item->target.wp; + struct session *s = target->s; + struct window_pane *wp = target->wp; const char *delay; double d; struct timeval tv; @@ -102,7 +102,7 @@ cmd_run_shell_exec(struct cmd *self, struct cmdq_item *item) cdata = xcalloc(1, sizeof *cdata); if (args->argc != 0) - cdata->cmd = format_single(item, args->argv[0], c, s, wl, wp); + cdata->cmd = format_single_from_target(item, args->argv[0], c); if (args_has(args, 't') && wp != NULL) cdata->wp_id = wp->id; @@ -112,7 +112,7 @@ cmd_run_shell_exec(struct cmd *self, struct cmdq_item *item) if (!args_has(args, 'b')) cdata->item = item; - cdata->cwd = xstrdup(server_client_get_cwd(item->client, s)); + cdata->cwd = xstrdup(server_client_get_cwd(cmdq_get_client(item), s)); cdata->s = s; if (s != NULL) session_add_ref(s, __func__); @@ -197,8 +197,9 @@ cmd_run_shell_callback(struct job *job) free(msg); if (item != NULL) { - if (item->client != NULL && item->client->session == NULL) - item->client->retval = retcode; + if (cmdq_get_client(item) != NULL && + cmdq_get_client(item)->session == NULL) + cmdq_get_client(item)->retval = retcode; cmdq_continue(item); } } -- cgit