From dd602eaa61e82188313b9187021accab260f89c0 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 6 Jul 2022 07:51:37 +0000 Subject: [PATCH 1/4] Mention whether time is creation/activity for sort orders. --- tmux.1 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tmux.1 b/tmux.1 index ee6740ac..1fc2d061 100644 --- a/tmux.1 +++ b/tmux.1 @@ -2112,9 +2112,11 @@ is not given, "detach-client -t '%%'" is used. specifies the initial sort field: one of .Ql name , .Ql size , -.Ql creation , +.Ql creation +(time), or -.Ql activity . +.Ql activity +(time). .Fl r reverses the sort order. .Fl f @@ -2196,7 +2198,8 @@ specifies the initial sort field: one of .Ql index , .Ql name , or -.Ql time . +.Ql time +(activity). .Fl r reverses the sort order. .Fl f @@ -6107,7 +6110,8 @@ is not given, "paste-buffer -b '%%'" is used. .Pp .Fl O specifies the initial sort field: one of -.Ql time , +.Ql time +(creation), .Ql name or .Ql size . From 9e03df5500f802e0a10d52bfaf51eab493b84c70 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 6 Jul 2022 08:31:59 +0000 Subject: [PATCH 2/4] Defer reading from control client until the command line command has completed. --- control.c | 8 +++++++- server-client.c | 5 ++++- tmux.h | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/control.c b/control.c index 359d0e78..f75035ef 100644 --- a/control.c +++ b/control.c @@ -776,7 +776,6 @@ control_start(struct client *c) cs->read_event = bufferevent_new(c->fd, control_read_callback, control_write_callback, control_error_callback, c); - bufferevent_enable(cs->read_event, EV_READ); if (c->flags & CLIENT_CONTROLCONTROL) cs->write_event = cs->read_event; @@ -793,6 +792,13 @@ control_start(struct client *c) } } +/* Control client ready. */ +void +control_ready(struct client *c) +{ + bufferevent_enable(c->control_state->read_event, EV_READ); +} + /* Discard all output for a client. */ void control_discard(struct client *c) diff --git a/server-client.c b/server-client.c index 7c4c2fdd..864b37b3 100644 --- a/server-client.c +++ b/server-client.c @@ -2791,8 +2791,11 @@ server_client_command_done(struct cmdq_item *item, __unused void *data) if (~c->flags & CLIENT_ATTACHED) c->flags |= CLIENT_EXIT; - else if (~c->flags & CLIENT_EXIT) + else if (~c->flags & CLIENT_EXIT) { + if (c->flags & CLIENT_CONTROL) + control_ready(c); tty_send_requests(&c->tty); + } return (CMD_RETURN_NORMAL); } diff --git a/tmux.h b/tmux.h index 3137ca3b..3f720e50 100644 --- a/tmux.h +++ b/tmux.h @@ -3134,6 +3134,7 @@ char *parse_window_name(const char *); /* control.c */ void control_discard(struct client *); void control_start(struct client *); +void control_ready(struct client *); void control_stop(struct client *); void control_set_pane_on(struct client *, struct window_pane *); void control_set_pane_off(struct client *, struct window_pane *); From a39827a85cede5d52bc164f0b18404449ed8bba6 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 6 Jul 2022 08:32:28 +0000 Subject: [PATCH 3/4] Remove debugging code. From 1afe22086fb85a596eb4a20f2e80cacfbbc2f1e5 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 6 Jul 2022 08:40:52 +0000 Subject: [PATCH 4/4] Show config errors on attach if they were not shown when the session was created. --- cmd-attach-session.c | 3 +++ cmd-new-session.c | 10 +++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cmd-attach-session.c b/cmd-attach-session.c index b92a7f2b..4e2d15da 100644 --- a/cmd-attach-session.c +++ b/cmd-attach-session.c @@ -158,6 +158,9 @@ cmd_attach_session(struct cmdq_item *item, const char *tflag, int dflag, c->flags |= CLIENT_ATTACHED; } + if (cfg_finished) + cfg_show_causes(s); + return (CMD_RETURN_NORMAL); } diff --git a/cmd-new-session.c b/cmd-new-session.c index b946f049..c90369bc 100644 --- a/cmd-new-session.c +++ b/cmd-new-session.c @@ -333,13 +333,6 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) server_client_set_key_table(c, NULL); } - /* - * If there are still configuration file errors to display, put the new - * session's current window into view mode and display them now. - */ - if (cfg_finished) - cfg_show_causes(s); - /* Print if requested. */ if (args_has(args, 'P')) { if ((template = args_get(args, 'F')) == NULL) @@ -357,6 +350,9 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) cmd_find_from_session(&fs, s, 0); cmdq_insert_hook(s, item, &fs, "after-new-session"); + if (cfg_finished) + cfg_show_causes(s); + if (sc.argv != NULL) cmd_free_argv(sc.argc, sc.argv); free(cwd);