=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-display-message.c,v retrieving revision 1.52 retrieving revision 1.53 diff -c -r1.52 -r1.53 *** src/usr.bin/tmux/cmd-display-message.c 2020/04/13 10:59:58 1.52 --- src/usr.bin/tmux/cmd-display-message.c 2020/04/13 20:51:57 1.53 *************** *** 1,4 **** ! /* $OpenBSD: cmd-display-message.c,v 1.52 2020/04/13 10:59:58 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha --- 1,4 ---- ! /* $OpenBSD: cmd-display-message.c,v 1.53 2020/04/13 20:51:57 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha *************** *** 45,51 **** .target = { 't', CMD_FIND_PANE, 0 }, ! .flags = CMD_AFTERHOOK, .exec = cmd_display_message_exec }; --- 45,51 ---- .target = { 't', CMD_FIND_PANE, 0 }, ! .flags = CMD_AFTERHOOK|CMD_CLIENT_CFLAG|CMD_CLIENT_CANFAIL, .exec = cmd_display_message_exec }; *************** *** 62,68 **** { struct args *args = cmd_get_args(self); struct cmd_find_state *target = cmdq_get_target(item); ! struct client *c, *target_c; struct session *s = target->s; struct winlink *wl = target->wl; struct window_pane *wp = target->wp; --- 62,68 ---- { struct args *args = cmd_get_args(self); struct cmd_find_state *target = cmdq_get_target(item); ! struct client *tc = cmdq_get_target_client(item), *c; struct session *s = target->s; struct winlink *wl = target->wl; struct window_pane *wp = target->wp; *************** *** 97,113 **** * formats too, assuming it matches the session. If it doesn't, use the * best client for the session. */ ! c = cmd_find_client(item, args_get(args, 'c'), 1); ! if (c != NULL && c->session == s) ! target_c = c; else ! target_c = cmd_find_best_client(s); if (args_has(args, 'v')) flags = FORMAT_VERBOSE; else flags = 0; ft = format_create(cmdq_get_client(item), item, FORMAT_NONE, flags); ! format_defaults(ft, target_c, s, wl, wp); if (args_has(args, 'a')) { format_each(ft, cmd_display_message_each, item); --- 97,112 ---- * formats too, assuming it matches the session. If it doesn't, use the * best client for the session. */ ! if (tc != NULL && tc->session == s) ! c = tc; else ! c = cmd_find_best_client(s); if (args_has(args, 'v')) flags = FORMAT_VERBOSE; else flags = 0; ft = format_create(cmdq_get_client(item), item, FORMAT_NONE, flags); ! format_defaults(ft, c, s, wl, wp); if (args_has(args, 'a')) { format_each(ft, cmd_display_message_each, item); *************** *** 117,124 **** msg = format_expand_time(ft, template); if (args_has(args, 'p')) cmdq_print(item, "%s", msg); ! else if (c != NULL) ! status_message_set(c, "%s", msg); free(msg); format_free(ft); --- 116,123 ---- msg = format_expand_time(ft, template); if (args_has(args, 'p')) cmdq_print(item, "%s", msg); ! else if (tc != NULL) ! status_message_set(tc, "%s", msg); free(msg); format_free(ft);