Skip to content

Commit

Permalink
Show config errors on attach if they were not shown when the session
Browse files Browse the repository at this point in the history
was created.
  • Loading branch information
nicm committed Jul 6, 2022
1 parent a39827a commit 1afe220
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
3 changes: 3 additions & 0 deletions cmd-attach-session.c
Expand Up @@ -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);
}

Expand Down
10 changes: 3 additions & 7 deletions cmd-new-session.c
Expand Up @@ -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)
Expand All @@ -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);
Expand Down

0 comments on commit 1afe220

Please sign in to comment.