Skip to content

Commit

Permalink
If display-time is set to 0, show status messages until a key is pres…
Browse files Browse the repository at this point in the history
…sed;

OK nicm@
  • Loading branch information
tim committed Nov 22, 2015
1 parent 933929c commit 4fcc02e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion options-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ const struct options_table_entry options_table[] = {
{ .name = "display-time",
.type = OPTIONS_TABLE_NUMBER,
.scope = OPTIONS_TABLE_SESSION,
.minimum = 1,
.minimum = 0,
.maximum = INT_MAX,
.default_num = 750
},
Expand Down
16 changes: 9 additions & 7 deletions status.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,13 +574,15 @@ status_message_set(struct client *c, const char *fmt, ...)
}

delay = options_get_number(c->session->options, "display-time");
tv.tv_sec = delay / 1000;
tv.tv_usec = (delay % 1000) * 1000L;

if (event_initialized(&c->message_timer))
evtimer_del(&c->message_timer);
evtimer_set(&c->message_timer, status_message_callback, c);
evtimer_add(&c->message_timer, &tv);
if (delay > 0) {
tv.tv_sec = delay / 1000;
tv.tv_usec = (delay % 1000) * 1000L;

if (event_initialized(&c->message_timer))
evtimer_del(&c->message_timer);
evtimer_set(&c->message_timer, status_message_callback, c);
evtimer_add(&c->message_timer, &tv);
}

c->tty.flags |= (TTY_NOCURSOR|TTY_FREEZE);
c->flags |= CLIENT_STATUS;
Expand Down
1 change: 1 addition & 0 deletions tmux.1
Original file line number Diff line number Diff line change
Expand Up @@ -2557,6 +2557,7 @@ command appear.
.It Ic display-time Ar time
Set the amount of time for which status line messages and other on-screen
indicators are displayed.
If set to 0, messages and indicators are displayed until a key is pressed.
.Ar time
is in milliseconds.
.It Ic history-limit Ar lines
Expand Down

0 comments on commit 4fcc02e

Please sign in to comment.