summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2021-09-16 06:39:23 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2021-09-16 06:39:23 +0000
commit1b5a5f0ed523d296f0f21aa114cc1d8f72cb4846 (patch)
tree3fcfa2fc4fb68c4ee26d1f61f8d55387e76f120e
parentc6f0da7a9e563e85fad3069387b31498e5ad349c (diff)
Fix run-shell -d with no command, GitHub issue 2885.
-rw-r--r--usr.bin/tmux/cmd-run-shell.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd-run-shell.c b/usr.bin/tmux/cmd-run-shell.c
index b60e14eebd8..06b1743f922 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.80 2021/09/15 07:38:30 nicm Exp $ */
+/* $OpenBSD: cmd-run-shell.c,v 1.81 2021/09/16 06:39:22 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -181,7 +181,13 @@ cmd_run_shell_timer(__unused int fd, __unused short events, void* arg)
struct cmd_list *cmdlist;
char *error;
- if (cdata->state == NULL && cmd != NULL) {
+ if (cdata->state == NULL) {
+ if (cmd == NULL) {
+ if (cdata->item != NULL)
+ cmdq_continue(cdata->item);
+ cmd_run_shell_free(cdata);
+ return;
+ }
if (job_run(cmd, 0, NULL, cdata->s, cdata->cwd, NULL,
cmd_run_shell_callback, cmd_run_shell_free, cdata,
cdata->flags, -1, -1) == NULL)