mirror of
https://github.com/tmux/tmux.git
synced 2024-12-13 01:48:47 +00:00
Make message-limit a server option.
This commit is contained in:
parent
78e783e786
commit
683ca270d4
@ -80,6 +80,13 @@ const struct options_table_entry server_options_table[] = {
|
|||||||
.default_num = 0
|
.default_num = 0
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{ .name = "message-limit",
|
||||||
|
.type = OPTIONS_TABLE_NUMBER,
|
||||||
|
.minimum = 0,
|
||||||
|
.maximum = INT_MAX,
|
||||||
|
.default_num = 100
|
||||||
|
},
|
||||||
|
|
||||||
{ .name = "quiet",
|
{ .name = "quiet",
|
||||||
.type = OPTIONS_TABLE_FLAG,
|
.type = OPTIONS_TABLE_FLAG,
|
||||||
.default_num = 0 /* overridden in main() */
|
.default_num = 0 /* overridden in main() */
|
||||||
@ -234,13 +241,6 @@ const struct options_table_entry session_options_table[] = {
|
|||||||
.style = "message-style"
|
.style = "message-style"
|
||||||
},
|
},
|
||||||
|
|
||||||
{ .name = "message-limit",
|
|
||||||
.type = OPTIONS_TABLE_NUMBER,
|
|
||||||
.minimum = 0,
|
|
||||||
.maximum = INT_MAX,
|
|
||||||
.default_num = 20
|
|
||||||
},
|
|
||||||
|
|
||||||
{ .name = "message-style",
|
{ .name = "message-style",
|
||||||
.type = OPTIONS_TABLE_STYLE,
|
.type = OPTIONS_TABLE_STYLE,
|
||||||
.default_str = "bg=yellow,fg=black"
|
.default_str = "bg=yellow,fg=black"
|
||||||
|
6
status.c
6
status.c
@ -655,7 +655,6 @@ void printflike2
|
|||||||
status_message_set(struct client *c, const char *fmt, ...)
|
status_message_set(struct client *c, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
struct session *s = c->session;
|
|
||||||
struct message_entry *msg;
|
struct message_entry *msg;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
int delay;
|
int delay;
|
||||||
@ -673,10 +672,7 @@ status_message_set(struct client *c, const char *fmt, ...)
|
|||||||
msg->msg_time = time(NULL);
|
msg->msg_time = time(NULL);
|
||||||
msg->msg = xstrdup(c->message_string);
|
msg->msg = xstrdup(c->message_string);
|
||||||
|
|
||||||
if (s == NULL)
|
limit = options_get_number(&global_options, "message-limit");
|
||||||
limit = 0;
|
|
||||||
else
|
|
||||||
limit = options_get_number(&s->options, "message-limit");
|
|
||||||
if (ARRAY_LENGTH(&c->message_log) > limit) {
|
if (ARRAY_LENGTH(&c->message_log) > limit) {
|
||||||
limit = ARRAY_LENGTH(&c->message_log) - limit;
|
limit = ARRAY_LENGTH(&c->message_log) - limit;
|
||||||
for (i = 0; i < limit; i++) {
|
for (i = 0; i < limit; i++) {
|
||||||
|
10
tmux.1
10
tmux.1
@ -782,7 +782,7 @@ Show client messages or server information.
|
|||||||
Any messages displayed on the status line are saved in a per-client message
|
Any messages displayed on the status line are saved in a per-client message
|
||||||
log, up to a maximum of the limit set by the
|
log, up to a maximum of the limit set by the
|
||||||
.Ar message-limit
|
.Ar message-limit
|
||||||
session option for the session attached to that client.
|
server option.
|
||||||
With
|
With
|
||||||
.Fl t ,
|
.Fl t ,
|
||||||
display the log for
|
display the log for
|
||||||
@ -2138,6 +2138,10 @@ passed through to applications running in
|
|||||||
.Nm .
|
.Nm .
|
||||||
Attached clients should be detached and attached again after changing this
|
Attached clients should be detached and attached again after changing this
|
||||||
option.
|
option.
|
||||||
|
.It Ic message-limit Ar number
|
||||||
|
Set the number of error or information messages to save in the message log for
|
||||||
|
each client.
|
||||||
|
The default is 100.
|
||||||
.It Xo Ic quiet
|
.It Xo Ic quiet
|
||||||
.Op Ic on | off
|
.Op Ic on | off
|
||||||
.Xc
|
.Xc
|
||||||
@ -2359,10 +2363,6 @@ With the
|
|||||||
flag to the
|
flag to the
|
||||||
.Ic set-option
|
.Ic set-option
|
||||||
command the new style is added otherwise the existing style is replaced.
|
command the new style is added otherwise the existing style is replaced.
|
||||||
.It Ic message-limit Ar number
|
|
||||||
Set the number of error or information messages to save in the message log for
|
|
||||||
each client.
|
|
||||||
The default is 20.
|
|
||||||
.It Ic message-style Ar style
|
.It Ic message-style Ar style
|
||||||
Set status line message style.
|
Set status line message style.
|
||||||
For how to specify
|
For how to specify
|
||||||
|
Loading…
Reference in New Issue
Block a user