summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/format.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2021-07-13 22:09:30 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2021-07-13 22:09:30 +0000
commit007b800205888e326e9da3b868b5244cac88976e (patch)
treefd3f79546560cc6ae72ab63d3dd5bef06c1ad394 /usr.bin/tmux/format.c
parentd373423bb59377ca5480591de772fb779060ef9a (diff)
Give #() commands a one second grace period where the output is empty
before telling the user they aren't doing anything. GitHub issue 2774.
Diffstat (limited to 'usr.bin/tmux/format.c')
-rw-r--r--usr.bin/tmux/format.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/tmux/format.c b/usr.bin/tmux/format.c
index c701323d01c..19ed9326947 100644
--- a/usr.bin/tmux/format.c
+++ b/usr.bin/tmux/format.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: format.c,v 1.287 2021/07/08 11:14:53 nicm Exp $ */
+/* $OpenBSD: format.c,v 1.288 2021/07/13 22:09:29 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -371,9 +371,6 @@ format_job_get(struct format_expand_state *es, const char *cmd)
fj->client = ft->client;
fj->tag = ft->tag;
fj->cmd = xstrdup(cmd);
- fj->expanded = NULL;
-
- xasprintf(&fj->out, "<'%s' not ready>", fj->cmd);
RB_INSERT(format_job_tree, jobs, fj);
}
@@ -402,11 +399,14 @@ format_job_get(struct format_expand_state *es, const char *cmd)
}
fj->last = t;
fj->updated = 0;
- }
+ } else if (fj->job != NULL && (t - fj->last) > 1 && fj->out == NULL)
+ xasprintf(&fj->out, "<'%s' not ready>", fj->cmd);
free(expanded);
if (ft->flags & FORMAT_STATUS)
fj->status = 1;
+ if (fj->out == NULL)
+ return (xstrdup(""));
return (format_expand1(&next, fj->out));
}