Compare commits

..

1 Commits

2 changed files with 15 additions and 5 deletions

View File

@@ -115,11 +115,15 @@ cmd_display_message_exec(struct cmd *self, struct cmdq_item *item)
/* /*
* -c is intended to be the client where the message should be * -c is intended to be the client where the message should be
* displayed if -p is not given. But it makes sense to use it for the * displayed if -p is not given, but it makes sense to use it for the
* formats too, assuming it matches the session. If it doesn't, use the * client formats too. If it was given explicitly, use it even when it
* best client for the session. * is not in the target session, since the formats should describe the
* client which was asked for; the session, window and pane formats
* still come from the target. Otherwise it is just the current client,
* so only use it if it matches the session and fall back to the best
* client for the session if not.
*/ */
if (tc != NULL && tc->session == s) if (tc != NULL && (args_has(args, 'c') || tc->session == s))
c = tc; c = tc;
else if (s != NULL) else if (s != NULL)
c = cmd_find_best_client(s); c = cmd_find_best_client(s);

8
tmux.1
View File

@@ -8328,11 +8328,17 @@ Otherwise, the format of
.Ar message .Ar message
is described in the is described in the
.Sx FORMATS .Sx FORMATS
section; information is taken from section; session, window and pane information is taken from
.Ar target\-pane .Ar target\-pane
if if
.Fl t .Fl t
is given, otherwise the active pane. is given, otherwise the active pane.
If
.Fl c
is given, the
.Ql #{client_*}
variables are taken from
.Ar target\-client .
.Pp .Pp
If If
.Fl j .Fl j