aboutsummaryrefslogtreecommitdiff
path: root/format.c
diff options
context:
space:
mode:
authornicm <nicm>2018-04-18 14:35:37 +0000
committernicm <nicm>2018-04-18 14:35:37 +0000
commit3dceddd70ea8491aed082efbb551ca352e97e03d (patch)
treebf5333f77aef71b6d6069664247b3708566da00c /format.c
parent2595718dd39a2aa66885b202c8ab04e0549370a4 (diff)
downloadrtmux-3dceddd70ea8491aed082efbb551ca352e97e03d.tar.gz
rtmux-3dceddd70ea8491aed082efbb551ca352e97e03d.tar.bz2
rtmux-3dceddd70ea8491aed082efbb551ca352e97e03d.zip
Change how display-message uses the client. Originally it was only
intended as the target client where the message should be displayed but at some point (perhaps when -p was added), it was used for format expansion too. This means it can get a bit weird where you have client formats expanding for a client with a different current session than the target session. However, it is nice that display-message can be used to show information about a specific client. So change so that the -c client will be used if the session matches the target session (-t or default), otherwise the best client will be chosen.
Diffstat (limited to 'format.c')
-rw-r--r--format.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/format.c b/format.c
index bf76fcf0..8f5ec063 100644
--- a/format.c
+++ b/format.c
@@ -1254,6 +1254,9 @@ void
format_defaults(struct format_tree *ft, struct client *c, struct session *s,
struct winlink *wl, struct window_pane *wp)
{
+ if (c != NULL && s != NULL && c->session != s)
+ log_debug("%s: session does not match", __func__);
+
format_add(ft, "session_format", "%d", s != NULL);
format_add(ft, "window_format", "%d", wl != NULL);
format_add(ft, "pane_format", "%d", wp != NULL);