diff options
author | Thomas Adam <thomas@xteddy.org> | 2022-06-20 12:01:09 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2022-06-20 12:01:09 +0100 |
commit | d46870ede5e79c748cf8d06a00cdcc7310846844 (patch) | |
tree | 9c6587a57012841885ffe3c1756495530e221cfa | |
parent | 8ff3091d1677159150dee3791cd244029b9f47d3 (diff) | |
parent | a888ce9963053c790c6ee9bf64cc53d95f0f9c09 (diff) |
Merge branch 'obsd-master'
-rw-r--r-- | cfg.c | 24 | ||||
-rw-r--r-- | cmd-new-session.c | 2 | ||||
-rw-r--r-- | tmux.1 | 2 |
3 files changed, 24 insertions, 4 deletions
@@ -51,8 +51,7 @@ cfg_done(__unused struct cmdq_item *item, __unused void *data) return (CMD_RETURN_NORMAL); cfg_finished = 1; - if (!RB_EMPTY(&sessions)) - cfg_show_causes(RB_MIN(sessions, &sessions)); + cfg_show_causes(NULL); if (cfg_item != NULL) cmdq_continue(cfg_item); @@ -238,11 +237,29 @@ cfg_print_causes(struct cmdq_item *item) void cfg_show_causes(struct session *s) { + struct client *c = TAILQ_FIRST(&clients); struct window_pane *wp; struct window_mode_entry *wme; u_int i; - if (s == NULL || cfg_ncauses == 0) + if (cfg_ncauses == 0) + return; + + if (c != NULL && (c->flags & CLIENT_CONTROL)) { + for (i = 0; i < cfg_ncauses; i++) { + control_write(c, "%%config-error %s", cfg_causes[i]); + free(cfg_causes[i]); + } + goto out; + } + + if (s == NULL) { + if (c != NULL && c->session != NULL) + s = c->session; + else + s = RB_MIN(sessions, &sessions); + } + if (s == NULL || s->attached == 0) /* wait for an attached session */ return; wp = s->curw->window->active; @@ -254,6 +271,7 @@ cfg_show_causes(struct session *s) free(cfg_causes[i]); } +out: free(cfg_causes); cfg_causes = NULL; cfg_ncauses = 0; diff --git a/cmd-new-session.c b/cmd-new-session.c index cb9abfb3..b946f049 100644 --- a/cmd-new-session.c +++ b/cmd-new-session.c @@ -335,7 +335,7 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) /* * If there are still configuration file errors to display, put the new - * session's current window into more mode and display them now. + * session's current window into view mode and display them now. */ if (cfg_finished) cfg_show_causes(s); @@ -6532,6 +6532,8 @@ The client is now attached to the session with ID .Ar session-id , which is named .Ar name . +.It Ic %config-error Ar error +An error has happened in a configuration file. .It Ic %continue Ar pane-id The pane has been continued after being paused (if the .Ar pause-after |