diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-03-17 23:45:19 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-03-17 23:45:19 +0000 |
commit | f5de847a0c8be02a16b06e2cae366c2edf539d10 (patch) | |
tree | f4e7d0eeca657405acb435296214033f0be9b9d4 /cmd-display-message.c | |
parent | b5516771d30536a7ee931a8331929bffd2103796 (diff) | |
parent | 6bdc947f6b8616e45ed0cf742ad143d138d3d6e2 (diff) | |
download | rtmux-f5de847a0c8be02a16b06e2cae366c2edf539d10.tar.gz rtmux-f5de847a0c8be02a16b06e2cae366c2edf539d10.tar.bz2 rtmux-f5de847a0c8be02a16b06e2cae366c2edf539d10.zip |
Merge branch 'master' of ssh://git.code.sf.net/p/tmux/tmux-code
Diffstat (limited to 'cmd-display-message.c')
-rw-r--r-- | cmd-display-message.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/cmd-display-message.c b/cmd-display-message.c index 319280ba..485ccf08 100644 --- a/cmd-display-message.c +++ b/cmd-display-message.c @@ -70,6 +70,18 @@ cmd_display_message_exec(struct cmd *self, struct cmd_q *cmdq) return (CMD_RETURN_ERROR); } + if (args_has(args, 'c')) { + c = cmd_find_client(cmdq, args_get(args, 'c'), 0); + if (c == NULL) + return (CMD_RETURN_ERROR); + } else { + c = cmd_current_client(cmdq); + if (c == NULL && !args_has(self->args, 'p')) { + cmdq_error(cmdq, "no client available"); + return (CMD_RETURN_ERROR); + } + } + template = args_get(args, 'F'); if (args->argc != 0) template = args->argv[0]; @@ -77,7 +89,7 @@ cmd_display_message_exec(struct cmd *self, struct cmd_q *cmdq) template = DISPLAY_MESSAGE_TEMPLATE; ft = format_create(); - if ((c = cmd_find_client(cmdq, args_get(args, 'c'), 1)) != NULL) + if (c != NULL) format_client(ft, c); format_session(ft, s); format_winlink(ft, s, wl); |