diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2017-02-03 11:57:29 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2017-02-03 11:57:29 +0000 |
commit | d9ef92f636f551ae9a14ff7ea4d98db94baddbcd (patch) | |
tree | c1d01b6dd31de79efd77bec51068dedaf3a32a43 /usr.bin/tmux/status.c | |
parent | 848681829586d1e67b7f69b169b7ec89e7e61ad9 (diff) |
Add a window or pane id "tag" to each format tree and use it to separate
jobs, this means that if the same job is used for different windows or
panes (for example in pane-border-format), it will be run separately for
each pane.
Diffstat (limited to 'usr.bin/tmux/status.c')
-rw-r--r-- | usr.bin/tmux/status.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/usr.bin/tmux/status.c b/usr.bin/tmux/status.c index 1a436d7cef0..7a587717cf0 100644 --- a/usr.bin/tmux/status.c +++ b/usr.bin/tmux/status.c @@ -1,4 +1,4 @@ -/* $OpenBSD: status.c,v 1.159 2017/01/13 11:56:43 nicm Exp $ */ +/* $OpenBSD: status.c,v 1.160 2017/02/03 11:57:27 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -500,14 +500,19 @@ status_replace(struct client *c, struct winlink *wl, const char *fmt, time_t t) { struct format_tree *ft; char *expanded; + u_int tag; if (fmt == NULL) return (xstrdup("")); + if (wl != NULL) + tag = FORMAT_WINDOW|wl->window->id; + else + tag = FORMAT_NONE; if (c->flags & CLIENT_STATUSFORCE) - ft = format_create(NULL, FORMAT_STATUS|FORMAT_FORCE); + ft = format_create(NULL, tag, FORMAT_STATUS|FORMAT_FORCE); else - ft = format_create(NULL, FORMAT_STATUS); + ft = format_create(NULL, tag, FORMAT_STATUS); format_defaults(ft, c, NULL, wl, NULL); expanded = format_expand_time(ft, fmt, t); @@ -665,7 +670,7 @@ status_prompt_set(struct client *c, const char *msg, const char *input, time_t t; char *tmp; - ft = format_create(NULL, 0); + ft = format_create(NULL, FORMAT_NONE, 0); format_defaults(ft, c, NULL, NULL, NULL); t = time(NULL); @@ -726,7 +731,7 @@ status_prompt_update(struct client *c, const char *msg, const char *input) time_t t; char *tmp; - ft = format_create(NULL, 0); + ft = format_create(NULL, FORMAT_NONE, 0); format_defaults(ft, c, NULL, NULL, NULL); t = time(NULL); |