diff options
author | Tiago Cunha <tcunha@gmx.com> | 2009-11-28 14:39:53 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2009-11-28 14:39:53 +0000 |
commit | 5f366e6d54c4825eb760424f86388e8813bb6189 (patch) | |
tree | d989ec947af3c4b21a31029ac99bec1a87936bc4 /cmd-display-message.c | |
parent | a3024f3d2a36beaa08d0b1c6faba076776ebf221 (diff) | |
download | rtmux-5f366e6d54c4825eb760424f86388e8813bb6189.tar.gz rtmux-5f366e6d54c4825eb760424f86388e8813bb6189.tar.bz2 rtmux-5f366e6d54c4825eb760424f86388e8813bb6189.zip |
Sync OpenBSD patchset 561:
Add a -p flag to display-message to print the output rather than displaying in
the status line, this allows things like "display -p '#W'" to find the current
window index.
Diffstat (limited to 'cmd-display-message.c')
-rw-r--r-- | cmd-display-message.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cmd-display-message.c b/cmd-display-message.c index 36266d32..13e68be7 100644 --- a/cmd-display-message.c +++ b/cmd-display-message.c @@ -1,4 +1,4 @@ -/* $Id: cmd-display-message.c,v 1.6 2009-11-19 22:35:10 tcunha Exp $ */ +/* $Id: cmd-display-message.c,v 1.7 2009-11-28 14:39:53 tcunha Exp $ */ /* * Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org> @@ -30,8 +30,8 @@ int cmd_display_message_exec(struct cmd *, struct cmd_ctx *); const struct cmd_entry cmd_display_message_entry = { "display-message", "display", - CMD_TARGET_CLIENT_USAGE " [message]", - CMD_ARG01, "", + "[-p] " CMD_TARGET_CLIENT_USAGE " [message]", + CMD_ARG01, "p", cmd_target_init, cmd_target_parse, cmd_display_message_exec, @@ -56,7 +56,10 @@ cmd_display_message_exec(struct cmd *self, struct cmd_ctx *ctx) template = data->arg; msg = status_replace(c, NULL, template, time(NULL), 0); - status_message_set(c, "%s", msg); + if (cmd_check_flag(data->chflags, 'p')) + ctx->print(ctx, "%s", msg); + else + status_message_set(c, "%s", msg); xfree(msg); return (0); |