mirror of
https://github.com/tmux/tmux.git
synced 2026-09-19 03:24:46 +00:00
Add display-message -c target-client, which causes the ‘#{client_*}’ variables to be taken from target-client.
This commit is contained in:
@@ -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
|
||||
* 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
|
||||
* best client for the session.
|
||||
* displayed if -p is not given, but it makes sense to use it for the
|
||||
* client formats too. If it was given explicitly, use it even when it
|
||||
* 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;
|
||||
else if (s != NULL)
|
||||
c = cmd_find_best_client(s);
|
||||
|
||||
8
tmux.1
8
tmux.1
@@ -8328,11 +8328,17 @@ Otherwise, the format of
|
||||
.Ar message
|
||||
is described in the
|
||||
.Sx FORMATS
|
||||
section; information is taken from
|
||||
section; session, window and pane information is taken from
|
||||
.Ar target\-pane
|
||||
if
|
||||
.Fl t
|
||||
is given, otherwise the active pane.
|
||||
If
|
||||
.Fl c
|
||||
is given, the
|
||||
.Ql #{client_*}
|
||||
variables are taken from
|
||||
.Ar target\-client .
|
||||
.Pp
|
||||
If
|
||||
.Fl j
|
||||
|
||||
Reference in New Issue
Block a user