-/* $OpenBSD: alerts.c,v 1.32 2020/08/19 07:15:42 nicm Exp $ */
+/* $OpenBSD: alerts.c,v 1.33 2021/04/12 09:36:12 nicm Exp $ */
/*
* Copyright (c) 2015 Nicholas Marriott <nicholas.marriott@gmail.com>
tty_putcode(&c->tty, TTYC_BEL);
if (visual == VISUAL_OFF)
continue;
- if (c->session->curw == wl)
- status_message_set(c, -1, 1, "%s in current window", type);
- else {
- status_message_set(c, -1, 1, "%s in window %d", type,
+ if (c->session->curw == wl) {
+ status_message_set(c, -1, 1, 0, "%s in current window",
+ type);
+ } else {
+ status_message_set(c, -1, 1, 0, "%s in window %d", type,
wl->idx);
}
}
-/* $OpenBSD: cmd-display-message.c,v 1.56 2021/04/07 12:49:33 nicm Exp $ */
+/* $OpenBSD: cmd-display-message.c,v 1.57 2021/04/12 09:36:12 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
.name = "display-message",
.alias = "display",
- .args = { "acd:Ipt:F:v", 0, 1 },
- .usage = "[-aIpv] [-c target-client] [-d delay] [-F format] "
+ .args = { "acd:INpt:F:v", 0, 1 },
+ .usage = "[-aINpv] [-c target-client] [-d delay] [-F format] "
CMD_TARGET_PANE_USAGE " [message]",
.target = { 't', CMD_FIND_PANE, CMD_FIND_CANFAIL },
cmdq_error(item, "%s", msg);
else if (args_has(args, 'p'))
cmdq_print(item, "%s", msg);
- else if (tc != NULL)
- status_message_set(tc, delay, 0, "%s", msg);
+ else if (tc != NULL) {
+ status_message_set(tc, delay, 0, args_has(args, 'N'), "%s",
+ msg);
+ }
free(msg);
format_free(ft);
-/* $OpenBSD: cmd-list-keys.c,v 1.61 2020/07/27 08:03:10 nicm Exp $ */
+/* $OpenBSD: cmd-list-keys.c,v 1.62 2021/04/12 09:36:12 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
else
note = xstrdup(bd->note);
tmp = utf8_padcstr(key, keywidth + 1);
- if (args_has(args, '1') && tc != NULL)
- status_message_set(tc, -1, 1, "%s%s%s", prefix, tmp, note);
- else
+ if (args_has(args, '1') && tc != NULL) {
+ status_message_set(tc, -1, 1, 0, "%s%s%s", prefix, tmp,
+ note);
+ } else
cmdq_print(item, "%s%s%s", prefix, tmp, note);
free(tmp);
free(note);
-/* $OpenBSD: cmd-queue.c,v 1.101 2021/04/07 12:50:12 nicm Exp $ */
+/* $OpenBSD: cmd-queue.c,v 1.102 2021/04/12 09:36:12 nicm Exp $ */
/*
* Copyright (c) 2013 Nicholas Marriott <nicholas.marriott@gmail.com>
c->retval = 1;
} else {
*msg = toupper((u_char) *msg);
- status_message_set(c, -1, 1, "%s", msg);
+ status_message_set(c, -1, 1, 0, "%s", msg);
}
free(msg);
-/* $OpenBSD: cmd-run-shell.c,v 1.72 2021/03/15 13:06:33 nicm Exp $ */
+/* $OpenBSD: cmd-run-shell.c,v 1.73 2021/04/12 09:36:12 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
if (status == CMD_PARSE_ERROR) {
if (cdata->item == NULL) {
*error = toupper((u_char)*error);
- status_message_set(c, -1, 1, "%s", error);
+ status_message_set(c, -1, 1, 0, "%s", error);
} else
cmdq_error(cdata->item, "%s", error);
free(error);
-/* $OpenBSD: mode-tree.c,v 1.52 2021/04/12 06:50:25 nicm Exp $ */
+/* $OpenBSD: mode-tree.c,v 1.53 2021/04/12 09:36:12 nicm Exp $ */
/*
* Copyright (c) 2017 Nicholas Marriott <nicholas.marriott@gmail.com>
if (status == CMD_PARSE_ERROR) {
if (c != NULL) {
*error = toupper((u_char)*error);
- status_message_set(c, -1, 1, "%s", error);
+ status_message_set(c, -1, 1, 0, "%s", error);
}
free(error);
}
-/* $OpenBSD: server-client.c,v 1.371 2021/04/05 14:11:05 nicm Exp $ */
+/* $OpenBSD: server-client.c,v 1.372 2021/04/12 09:36:12 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
* immediately rather than queued.
*/
if (~c->flags & CLIENT_READONLY) {
- status_message_clear(c);
+ if (c->message_string != NULL) {
+ if (c->message_ignore_keys)
+ return (0);
+ status_message_clear(c);
+ }
if (c->overlay_key != NULL) {
switch (c->overlay_key(c, event)) {
case 0:
-/* $OpenBSD: status.c,v 1.220 2021/02/22 06:53:04 nicm Exp $ */
+/* $OpenBSD: status.c,v 1.221 2021/04/12 09:36:12 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
/* Set a status line message. */
void
status_message_set(struct client *c, int delay, int ignore_styles,
- const char *fmt, ...)
+ int ignore_keys, const char *fmt, ...)
{
struct timeval tv;
va_list ap;
status_push_screen(c);
va_start(ap, fmt);
- c->message_ignore_styles = ignore_styles;
xvasprintf(&c->message_string, fmt, ap);
va_end(ap);
evtimer_add(&c->message_timer, &tv);
}
+ if (delay != 0)
+ c->message_ignore_keys = ignore_keys;
+ c->message_ignore_styles = ignore_styles;
+
c->tty.flags |= (TTY_NOCURSOR|TTY_FREEZE);
c->flags |= CLIENT_REDRAWSTATUS;
}
-.\" $OpenBSD: tmux.1,v 1.833 2021/04/12 06:50:25 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.834 2021/04/12 09:36:12 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
.\"
.It Li "q" Ta "Exit menu"
.El
.It Xo Ic display-message
-.Op Fl aIpv
+.Op Fl aINpv
.Op Fl c Ar target-client
.Op Fl d Ar delay
.Op Fl t Ar target-pane
is not given, the
.Ic message-time
option is used; a delay of zero waits for a key press.
+.Ql N
+ignores key presses and closes only after the delay expires.
The format of
.Ar message
is described in the
-/* $OpenBSD: tmux.h,v 1.1102 2021/04/12 06:50:25 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.1103 2021/04/12 09:36:12 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
uint64_t redraw_panes;
+ int message_ignore_keys;
int message_ignore_styles;
char *message_string;
struct event message_timer;
void status_init(struct client *);
void status_free(struct client *);
int status_redraw(struct client *);
-void status_message_set(struct client *, int, int, const char *, ...);
+void status_message_set(struct client *, int, int, int, const char *, ...);
void status_message_clear(struct client *);
int status_message_redraw(struct client *);
void status_prompt_set(struct client *, struct cmd_find_state *,
-/* $OpenBSD: window-customize.c,v 1.9 2021/04/12 06:50:25 nicm Exp $ */
+/* $OpenBSD: window-customize.c,v 1.10 2021/04/12 09:36:12 nicm Exp $ */
/*
* Copyright (c) 2020 Nicholas Marriott <nicholas.marriott@gmail.com>
fail:
*cause = toupper((u_char)*cause);
- status_message_set(c, -1, 1, "%s", cause);
+ status_message_set(c, -1, 1, 0, "%s", cause);
free(cause);
return (0);
}
fail:
*error = toupper((u_char)*error);
- status_message_set(c, -1, 1, "%s", error);
+ status_message_set(c, -1, 1, 0, "%s", error);
free(error);
return (0);
}