mirror of
https://github.com/tmux/tmux.git
synced 2025-01-13 03:48:51 +00:00
Merge branch 'obsd-master'
This commit is contained in:
commit
96ad1d7779
@ -1636,3 +1636,34 @@ server_client_push_stderr(struct client *c)
|
|||||||
log_debug("%s: client %p, queued", __func__, c);
|
log_debug("%s: client %p, queued", __func__, c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Add to client message log. */
|
||||||
|
void
|
||||||
|
server_client_add_message(struct client *c, const char *fmt, ...)
|
||||||
|
{
|
||||||
|
struct message_entry *msg, *msg1;
|
||||||
|
char *s;
|
||||||
|
va_list ap;
|
||||||
|
u_int limit;
|
||||||
|
|
||||||
|
va_start(ap, fmt);
|
||||||
|
xvasprintf(&s, fmt, ap);
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
|
log_debug("%s: message %s", c->tty.path, s);
|
||||||
|
|
||||||
|
msg = xcalloc(1, sizeof *msg);
|
||||||
|
msg->msg_time = time(NULL);
|
||||||
|
msg->msg_num = c->message_next++;
|
||||||
|
msg->msg = s;
|
||||||
|
TAILQ_INSERT_TAIL(&c->message_log, msg, entry);
|
||||||
|
|
||||||
|
limit = options_get_number(global_options, "message-limit");
|
||||||
|
TAILQ_FOREACH_SAFE(msg, &c->message_log, entry, msg1) {
|
||||||
|
if (msg->msg_num + limit >= c->message_next)
|
||||||
|
break;
|
||||||
|
free(msg->msg);
|
||||||
|
TAILQ_REMOVE(&c->message_log, msg, entry);
|
||||||
|
free(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
18
status.c
18
status.c
@ -563,12 +563,8 @@ void
|
|||||||
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 message_entry *msg, *msg1;
|
|
||||||
va_list ap;
|
va_list ap;
|
||||||
int delay;
|
int delay;
|
||||||
u_int limit;
|
|
||||||
|
|
||||||
limit = options_get_number(global_options, "message-limit");
|
|
||||||
|
|
||||||
status_message_clear(c);
|
status_message_clear(c);
|
||||||
|
|
||||||
@ -576,19 +572,7 @@ status_message_set(struct client *c, const char *fmt, ...)
|
|||||||
xvasprintf(&c->message_string, fmt, ap);
|
xvasprintf(&c->message_string, fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
msg = xcalloc(1, sizeof *msg);
|
server_client_add_message(c, "%s", c->message_string);
|
||||||
msg->msg_time = time(NULL);
|
|
||||||
msg->msg_num = c->message_next++;
|
|
||||||
msg->msg = xstrdup(c->message_string);
|
|
||||||
TAILQ_INSERT_TAIL(&c->message_log, msg, entry);
|
|
||||||
|
|
||||||
TAILQ_FOREACH_SAFE(msg, &c->message_log, entry, msg1) {
|
|
||||||
if (msg->msg_num + limit >= c->message_next)
|
|
||||||
break;
|
|
||||||
free(msg->msg);
|
|
||||||
TAILQ_REMOVE(&c->message_log, msg, entry);
|
|
||||||
free(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
delay = options_get_number(c->session->options, "display-time");
|
delay = options_get_number(c->session->options, "display-time");
|
||||||
if (delay > 0) {
|
if (delay > 0) {
|
||||||
|
2
tmux.1
2
tmux.1
@ -838,7 +838,7 @@ is used,
|
|||||||
.Fl x
|
.Fl x
|
||||||
and
|
and
|
||||||
.Fl y
|
.Fl y
|
||||||
specify the size of the initial window (80 by 24 if not given).
|
specify the size of the initial window.
|
||||||
.Pp
|
.Pp
|
||||||
If run from a terminal, any
|
If run from a terminal, any
|
||||||
.Xr termios 4
|
.Xr termios 4
|
||||||
|
2
tmux.h
2
tmux.h
@ -1830,6 +1830,8 @@ void server_client_exec(struct client *, const char *);
|
|||||||
void server_client_loop(void);
|
void server_client_loop(void);
|
||||||
void server_client_push_stdout(struct client *);
|
void server_client_push_stdout(struct client *);
|
||||||
void server_client_push_stderr(struct client *);
|
void server_client_push_stderr(struct client *);
|
||||||
|
void printflike(2, 3) server_client_add_message(struct client *, const char *,
|
||||||
|
...);
|
||||||
|
|
||||||
/* server-fn.c */
|
/* server-fn.c */
|
||||||
void server_fill_environ(struct session *, struct environ *);
|
void server_fill_environ(struct session *, struct environ *);
|
||||||
|
Loading…
Reference in New Issue
Block a user