aboutsummaryrefslogtreecommitdiff
path: root/server-client.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2020-05-06 13:43:22 +0100
committerNicholas Marriott <nicholas.marriott@gmail.com>2020-05-06 13:43:22 +0100
commit7a95e9bf7ec80c7b87dda73749e59f359371d78a (patch)
treea28ae9e721c1d4d08be4d942dd2ea08d92bc7006 /server-client.c
parentc80fc6bf9e44baaad1e6f4a4c83ec47823e96c1b (diff)
downloadrtmux-7a95e9bf7ec80c7b87dda73749e59f359371d78a.tar.gz
rtmux-7a95e9bf7ec80c7b87dda73749e59f359371d78a.tar.bz2
rtmux-7a95e9bf7ec80c7b87dda73749e59f359371d78a.zip
Change message log to be per server rather than per client and include every
command that is run.
Diffstat (limited to 'server-client.c')
-rw-r--r--server-client.c49
1 files changed, 1 insertions, 48 deletions
diff --git a/server-client.c b/server-client.c
index 6de6e97d..794cb41e 100644
--- a/server-client.c
+++ b/server-client.c
@@ -211,23 +211,12 @@ server_client_create(int fd)
c->queue = cmdq_new();
c->tty.fd = -1;
- c->title = NULL;
-
- c->session = NULL;
- c->last_session = NULL;
c->tty.sx = 80;
c->tty.sy = 24;
status_init(c);
- c->message_string = NULL;
- TAILQ_INIT(&c->message_log);
-
- c->prompt_string = NULL;
- c->prompt_buffer = NULL;
- c->prompt_index = 0;
-
RB_INIT(&c->files);
c->flags |= CLIENT_FOCUSED;
@@ -270,7 +259,6 @@ server_client_open(struct client *c, char **cause)
void
server_client_lost(struct client *c)
{
- struct message_entry *msg, *msg1;
struct client_file *cf;
c->flags |= CLIENT_DEAD;
@@ -311,11 +299,6 @@ server_client_lost(struct client *c)
free(c->message_string);
if (event_initialized(&c->message_timer))
evtimer_del(&c->message_timer);
- TAILQ_FOREACH_SAFE(msg, &c->message_log, entry, msg1) {
- free(msg->msg);
- TAILQ_REMOVE(&c->message_log, msg, entry);
- free(msg);
- }
free(c->prompt_saved);
free(c->prompt_string);
@@ -1126,6 +1109,7 @@ server_client_key_callback(struct cmdq_item *item, void *data)
c->tty.mouse_drag_update(c, m);
goto out;
}
+ event->key = key;
}
/* Find affected pane. */
@@ -2206,37 +2190,6 @@ server_client_dispatch_read_done(struct client *c, struct imsg *imsg)
file_fire_done(cf);
}
-/* 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("message %s (client %p)", s, c);
-
- 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);
- }
-}
-
/* Get client working directory. */
const char *
server_client_get_cwd(struct client *c, struct session *s)