summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2019-03-18 09:46:43 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2019-03-18 09:46:43 +0000
commit5a8eaa0a68c954bbda725f9c5cc7f79b878532a8 (patch)
treefde76b3da7deae58c826542a0e8092b3cda1895e /usr.bin
parente1a85945f5939b5c44b71eca7c860c8a516d1b7a (diff)
With force, kill previous job before starting new. Fixes problem
reported by Scott Mcdermott in GitHub issue 1627.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/format.c6
-rw-r--r--usr.bin/tmux/status.c4
2 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/tmux/format.c b/usr.bin/tmux/format.c
index 97f83903b8e..58a19e69d64 100644
--- a/usr.bin/tmux/format.c
+++ b/usr.bin/tmux/format.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: format.c,v 1.182 2019/03/15 15:02:25 nicm Exp $ */
+/* $OpenBSD: format.c,v 1.183 2019/03/18 09:46:42 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -346,7 +346,9 @@ format_job_get(struct format_tree *ft, const char *cmd)
force = (ft->flags & FORMAT_FORCE);
t = time(NULL);
- if (fj->job == NULL && (force || fj->last != t)) {
+ if (force && fj->job != NULL)
+ job_free(fj->job);
+ if (force || (fj->job == NULL && fj->last != t)) {
fj->job = job_run(expanded, NULL,
server_client_get_cwd(ft->client, NULL), format_job_update,
format_job_complete, NULL, fj, JOB_NOWAIT);
diff --git a/usr.bin/tmux/status.c b/usr.bin/tmux/status.c
index eafc0088b70..c9b439e2311 100644
--- a/usr.bin/tmux/status.c
+++ b/usr.bin/tmux/status.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: status.c,v 1.189 2019/03/16 19:12:13 nicm Exp $ */
+/* $OpenBSD: status.c,v 1.190 2019/03/18 09:46:42 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -704,7 +704,7 @@ status_message_redraw(struct client *c)
lines = status_line_size(c);
if (lines <= 1)
lines = 1;
- screen_init(sl->active, c->tty.sx, 1, 0);
+ screen_init(sl->active, c->tty.sx, lines, 0);
len = screen_write_strlen("%s", c->message_string);
if (len > c->tty.sx)