diff options
Diffstat (limited to 'usr.bin/tmux/cmd-run-shell.c')
-rw-r--r-- | usr.bin/tmux/cmd-run-shell.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/usr.bin/tmux/cmd-run-shell.c b/usr.bin/tmux/cmd-run-shell.c index 8e3b7cade5c..0f10f387ed8 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.45 2017/02/16 10:53:25 nicm Exp $ */ +/* $OpenBSD: cmd-run-shell.c,v 1.46 2017/03/08 13:36:12 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org> @@ -86,11 +86,10 @@ cmd_run_shell_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; struct cmd_run_shell_data *cdata; - char *shellcmd; + struct client *c = item->state.c; struct session *s = item->state.tflag.s; struct winlink *wl = item->state.tflag.wl; struct window_pane *wp = item->state.tflag.wp; - struct format_tree *ft; const char *cwd; if (item->client != NULL && item->client->session == NULL) @@ -100,13 +99,8 @@ cmd_run_shell_exec(struct cmd *self, struct cmdq_item *item) else cwd = NULL; - ft = format_create(item, FORMAT_NONE, 0); - format_defaults(ft, item->state.c, s, wl, wp); - shellcmd = format_expand(ft, args->argv[0]); - format_free(ft); - cdata = xcalloc(1, sizeof *cdata); - cdata->cmd = shellcmd; + cdata->cmd = format_single(item, args->argv[0], c, s, wl, wp); if (args_has(args, 't') && wp != NULL) cdata->wp_id = wp->id; @@ -116,7 +110,7 @@ cmd_run_shell_exec(struct cmd *self, struct cmdq_item *item) if (!args_has(args, 'b')) cdata->item = item; - job_run(shellcmd, s, cwd, cmd_run_shell_callback, cmd_run_shell_free, + job_run(cdata->cmd, s, cwd, cmd_run_shell_callback, cmd_run_shell_free, cdata); if (args_has(args, 'b')) |