If display-time is set to 0, show status messages until a key is pressed;

OK nicm@
This commit is contained in:
tim 2015-11-22 18:28:01 +00:00
parent 933929cd62
commit 4fcc02ee9d
3 changed files with 10 additions and 7 deletions

View File

@ -198,7 +198,7 @@ const struct options_table_entry options_table[] = {
{ .name = "display-time", { .name = "display-time",
.type = OPTIONS_TABLE_NUMBER, .type = OPTIONS_TABLE_NUMBER,
.scope = OPTIONS_TABLE_SESSION, .scope = OPTIONS_TABLE_SESSION,
.minimum = 1, .minimum = 0,
.maximum = INT_MAX, .maximum = INT_MAX,
.default_num = 750 .default_num = 750
}, },

View File

@ -574,13 +574,15 @@ status_message_set(struct client *c, const char *fmt, ...)
} }
delay = options_get_number(c->session->options, "display-time"); delay = options_get_number(c->session->options, "display-time");
tv.tv_sec = delay / 1000; if (delay > 0) {
tv.tv_usec = (delay % 1000) * 1000L; tv.tv_sec = delay / 1000;
tv.tv_usec = (delay % 1000) * 1000L;
if (event_initialized(&c->message_timer)) if (event_initialized(&c->message_timer))
evtimer_del(&c->message_timer); evtimer_del(&c->message_timer);
evtimer_set(&c->message_timer, status_message_callback, c); evtimer_set(&c->message_timer, status_message_callback, c);
evtimer_add(&c->message_timer, &tv); evtimer_add(&c->message_timer, &tv);
}
c->tty.flags |= (TTY_NOCURSOR|TTY_FREEZE); c->tty.flags |= (TTY_NOCURSOR|TTY_FREEZE);
c->flags |= CLIENT_STATUS; c->flags |= CLIENT_STATUS;

1
tmux.1
View File

@ -2557,6 +2557,7 @@ command appear.
.It Ic display-time Ar time .It Ic display-time Ar time
Set the amount of time for which status line messages and other on-screen Set the amount of time for which status line messages and other on-screen
indicators are displayed. indicators are displayed.
If set to 0, messages and indicators are displayed until a key is pressed.
.Ar time .Ar time
is in milliseconds. is in milliseconds.
.It Ic history-limit Ar lines .It Ic history-limit Ar lines