diff options
author | nicm <nicm> | 2021-07-13 22:09:29 +0000 |
---|---|---|
committer | nicm <nicm> | 2021-07-13 22:09:29 +0000 |
commit | 38c5788232e0e3abdd08ade55a9d4fbcda637df1 (patch) | |
tree | d7e89752b19583ba5882c6ead7f77947d993267c /format.c | |
parent | df3fe2aa72da0555106c6187e750418f0e59d901 (diff) | |
download | rtmux-38c5788232e0e3abdd08ade55a9d4fbcda637df1.tar.gz rtmux-38c5788232e0e3abdd08ade55a9d4fbcda637df1.tar.bz2 rtmux-38c5788232e0e3abdd08ade55a9d4fbcda637df1.zip |
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 'format.c')
-rw-r--r-- | format.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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)); } |