summaryrefslogtreecommitdiffstats
path: root/cmd-display-message.c
diff options
context:
space:
mode:
authornicm <nicm>2022-11-03 08:33:57 +0000
committernicm <nicm>2022-11-03 08:33:57 +0000
commit3be369522b6de38ba08ee50a86a49a9a86af490b (patch)
tree50de0761a52ec8c3e1c6973ad38f04024d0e994c /cmd-display-message.c
parent9614f5156079773b338a13e95ec932cc7c95b031 (diff)
Add a -l flag to display-message to disable format expansion, from Aaron
Jensen. GitHub issue 3372.
Diffstat (limited to 'cmd-display-message.c')
-rw-r--r--cmd-display-message.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/cmd-display-message.c b/cmd-display-message.c
index 7828f694..f5e91020 100644
--- a/cmd-display-message.c
+++ b/cmd-display-message.c
@@ -39,8 +39,8 @@ const struct cmd_entry cmd_display_message_entry = {
.name = "display-message",
.alias = "display",
- .args = { "ac:d:INpt:F:v", 0, 1, NULL },
- .usage = "[-aINpv] [-c target-client] [-d delay] [-F format] "
+ .args = { "ac:d:lINpt:F:v", 0, 1, NULL },
+ .usage = "[-aIlNpv] [-c target-client] [-d delay] [-F format] "
CMD_TARGET_PANE_USAGE " [message]",
.target = { 't', CMD_FIND_PANE, CMD_FIND_CANFAIL },
@@ -132,7 +132,11 @@ cmd_display_message_exec(struct cmd *self, struct cmdq_item *item)
return (CMD_RETURN_NORMAL);
}
- msg = format_expand_time(ft, template);
+ if (args_has(args, 'l'))
+ msg = xstrdup(template);
+ else
+ msg = format_expand_time(ft, template);
+
if (cmdq_get_client(item) == NULL)
cmdq_error(item, "%s", msg);
else if (args_has(args, 'p'))