Allow show-messages to work without a client.

This commit is contained in:
nicm
2025-11-18 08:37:54 +00:00
parent 72117debf7
commit b52dcff745

View File

@@ -43,7 +43,7 @@ const struct cmd_entry cmd_show_messages_entry = {
.args = { "JTt:", 0, 0, NULL },
.usage = "[-JT] " CMD_TARGET_CLIENT_USAGE,
.flags = CMD_AFTERHOOK|CMD_CLIENT_TFLAG,
.flags = CMD_AFTERHOOK|CMD_CLIENT_TFLAG|CMD_CLIENT_CANFAIL,
.exec = cmd_show_messages_exec
};
@@ -57,7 +57,7 @@ cmd_show_messages_terminals(struct cmd *self, struct cmdq_item *item, int blank)
n = 0;
LIST_FOREACH(term, &tty_terms, entry) {
if (args_has(args, 't') && term != tc->tty.term)
if (args_has(args, 't') && tc != NULL && term != tc->tty.term)
continue;
if (blank) {
cmdq_print(item, "%s", "");