summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-run-shell.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/tmux/cmd-run-shell.c')
-rw-r--r--usr.bin/tmux/cmd-run-shell.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd-run-shell.c b/usr.bin/tmux/cmd-run-shell.c
index a37ae46bace..cbb4a888cc9 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.54 2018/08/23 15:45:05 nicm Exp $ */
+/* $OpenBSD: cmd-run-shell.c,v 1.55 2018/08/27 11:03:34 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -102,8 +102,12 @@ cmd_run_shell_exec(struct cmd *self, struct cmdq_item *item)
if (!args_has(args, 'b'))
cdata->item = item;
- job_run(cdata->cmd, s, server_client_get_cwd(item->client, s), NULL,
- cmd_run_shell_callback, cmd_run_shell_free, cdata, 0);
+ if (job_run(cdata->cmd, s, server_client_get_cwd(item->client, s), NULL,
+ cmd_run_shell_callback, cmd_run_shell_free, cdata, 0) == NULL) {
+ cmdq_error(item, "failed to run command: %s", cdata->cmd);
+ free(cdata);
+ return (CMD_RETURN_ERROR);
+ }
if (args_has(args, 'b'))
return (CMD_RETURN_NORMAL);