summaryrefslogtreecommitdiffstats
path: root/cmd-run-shell.c
diff options
context:
space:
mode:
authornicm <nicm>2020-04-13 10:59:58 +0000
committernicm <nicm>2020-04-13 10:59:58 +0000
commit04cdd035250b93b728678d515b69690653dced4e (patch)
tree34edc5f4affb9a640a95c7d531eb06770b6ea3c9 /cmd-run-shell.c
parentc20eb0c0ae3347c768894a6355adfd7ebae6f2f3 (diff)
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).
Diffstat (limited to 'cmd-run-shell.c')
-rw-r--r--cmd-run-shell.c15
1 files changed, 8 insertions, 7 deletions
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);
}
}