mirror of
https://github.com/tmate-io/tmate.git
synced 2025-06-19 17:17:53 +02:00
fix options
This commit is contained in:
parent
76ab267a35
commit
49f07dca50
13
tmate-msg.c
13
tmate-msg.c
@ -8,11 +8,13 @@ void status_message_callback(int, short, void *);
|
|||||||
static void tmate_status_message_client(struct client *c, const char *message)
|
static void tmate_status_message_client(struct client *c, const char *message)
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
struct session *s = c->session;
|
|
||||||
struct message_entry *msg, *msg1;
|
struct message_entry *msg, *msg1;
|
||||||
int delay;
|
int delay;
|
||||||
u_int first, limit;
|
u_int first, limit;
|
||||||
|
|
||||||
|
limit = options_get_number(global_options, "message-limit");
|
||||||
|
delay = c->session ? options_get_number(c->session->options, "tmate-display-time") : 30000;
|
||||||
|
|
||||||
status_prompt_clear(c);
|
status_prompt_clear(c);
|
||||||
status_message_clear(c);
|
status_message_clear(c);
|
||||||
|
|
||||||
@ -24,15 +26,6 @@ static void tmate_status_message_client(struct client *c, const char *message)
|
|||||||
msg->msg = xstrdup(c->message_string);
|
msg->msg = xstrdup(c->message_string);
|
||||||
TAILQ_INSERT_TAIL(&c->message_log, msg, entry);
|
TAILQ_INSERT_TAIL(&c->message_log, msg, entry);
|
||||||
|
|
||||||
if (s) {
|
|
||||||
limit = options_get_number(s->options, "message-limit");
|
|
||||||
delay = options_get_number(s->options, "tmate-display-time");
|
|
||||||
} else {
|
|
||||||
/* Very early in the connection process we won't have a session */
|
|
||||||
limit = options_get_number(global_s_options, "message-limit");
|
|
||||||
delay = options_get_number(global_s_options, "tmate-display-time");
|
|
||||||
}
|
|
||||||
|
|
||||||
first = c->message_next - limit;
|
first = c->message_next - limit;
|
||||||
TAILQ_FOREACH_SAFE(msg, &c->message_log, entry, msg1) {
|
TAILQ_FOREACH_SAFE(msg, &c->message_log, entry, msg1) {
|
||||||
if (msg->msg_num >= first)
|
if (msg->msg_num >= first)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user