summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-run-shell.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2020-04-13 11:00:00 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2020-04-13 11:00:00 +0000
commit56530d4d9e327bc4c76b8b02290102a1fadfffb9 (patch)
treec902ce5f812b38436dec697a5fa08bf3615c0ed4 /usr.bin/tmux/cmd-run-shell.c
parent9947eee19da9830a3c591d7fb4574df8cdd144e6 (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 'usr.bin/tmux/cmd-run-shell.c')
-rw-r--r--usr.bin/tmux/cmd-run-shell.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/usr.bin/tmux/cmd-run-shell.c b/usr.bin/tmux/cmd-run-shell.c
index 816826f8478..e83ca6aae45 100644
--- a/usr.bin/tmux/cmd-run-shell.c
+++ b/usr.bin/tmux/cmd-run-shell.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-run-shell.c,v 1.65 2020/04/13 08:26:27 nicm Exp $ */
+/* $OpenBSD: cmd-run-shell.c,v 1.66 2020/04/13 10:59:58 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -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);
}
}