From: nicm Date: Wed, 6 Jul 2022 08:40:52 +0000 (+0000) Subject: Show config errors on attach if they were not shown when the session X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8e309d18bf90f4983b96a7af2a17b66380c6597c;p=openbsd Show config errors on attach if they were not shown when the session was created. --- diff --git a/usr.bin/tmux/cmd-attach-session.c b/usr.bin/tmux/cmd-attach-session.c index 855c27c0804..3c0a39c323d 100644 --- a/usr.bin/tmux/cmd-attach-session.c +++ b/usr.bin/tmux/cmd-attach-session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-attach-session.c,v 1.88 2022/05/30 12:48:57 nicm Exp $ */ +/* $OpenBSD: cmd-attach-session.c,v 1.89 2022/07/06 08:40:52 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -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/usr.bin/tmux/cmd-new-session.c b/usr.bin/tmux/cmd-new-session.c index a3c1f82bbd2..5c9bd9d2191 100644 --- a/usr.bin/tmux/cmd-new-session.c +++ b/usr.bin/tmux/cmd-new-session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-new-session.c,v 1.145 2022/06/20 07:59:37 nicm Exp $ */ +/* $OpenBSD: cmd-new-session.c,v 1.146 2022/07/06 08:40:52 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -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);