From ccd4dd7ff2a24eec2e3a5e12aaf96563fe659139 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 6 Jan 2026 09:11:15 +0000 Subject: [PATCH 1/2] Do not log theme if pane is NULL. --- input.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/input.c b/input.c index 0fd02dce..4f5bd38f 100644 --- a/input.c +++ b/input.c @@ -3397,6 +3397,8 @@ input_report_current_theme(struct input_ctx *ictx) { struct window_pane *wp = ictx->wp; + if (wp == NULL) + return; switch (window_pane_get_theme(wp)) { case THEME_DARK: log_debug("%s: %%%u dark theme", __func__, wp->id); From 5f9dac8abcc82d45a0cc38310059f86f840f5b75 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 6 Jan 2026 10:17:29 +0000 Subject: [PATCH 2/2] Do not use ;;s in list-keys output as it is confusing and cannot be parsed on input, from Patrick Motard in GitHub issue 4750. --- cmd-list-keys.c | 6 ++++-- cmd.c | 6 ++++-- tmux.h | 2 ++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/cmd-list-keys.c b/cmd-list-keys.c index ddfc0e0c..f25b0636 100644 --- a/cmd-list-keys.c +++ b/cmd-list-keys.c @@ -109,7 +109,8 @@ cmd_list_keys_print_notes(struct cmdq_item *item, struct args *args, key = key_string_lookup_key(bd->key, 0); if (bd->note == NULL || *bd->note == '\0') - note = cmd_list_print(bd->cmdlist, 1); + note = cmd_list_print(bd->cmdlist, + CMD_LIST_PRINT_ESCAPED|CMD_LIST_PRINT_NO_GROUPS); else note = xstrdup(bd->note); tmp = utf8_padcstr(key, keywidth + 1); @@ -288,7 +289,8 @@ cmd_list_keys_exec(struct cmd *self, struct cmdq_item *item) tmpused = strlcat(tmp, " ", tmpsize); free(cp); - cp = cmd_list_print(bd->cmdlist, 1); + cp = cmd_list_print(bd->cmdlist, + CMD_LIST_PRINT_ESCAPED|CMD_LIST_PRINT_NO_GROUPS); cplen = strlen(cp); while (tmpused + cplen + 1 >= tmpsize) { tmpsize *= 2; diff --git a/cmd.c b/cmd.c index 119b685a..e5ec9cc5 100644 --- a/cmd.c +++ b/cmd.c @@ -677,12 +677,14 @@ cmd_list_copy(const struct cmd_list *cmdlist, int argc, char **argv) /* Get a command list as a string. */ char * -cmd_list_print(const struct cmd_list *cmdlist, int escaped) +cmd_list_print(const struct cmd_list *cmdlist, int flags) { struct cmd *cmd, *next; char *buf, *this; size_t len; const char *separator; + int escaped = flags & CMD_LIST_PRINT_ESCAPED; + int no_groups = flags & CMD_LIST_PRINT_NO_GROUPS; const char *single_separator = escaped ? " \\; " : " ; "; const char *double_separator = escaped ? " \\;\\; " : " ;; "; @@ -699,7 +701,7 @@ cmd_list_print(const struct cmd_list *cmdlist, int escaped) next = TAILQ_NEXT(cmd, qentry); if (next != NULL) { - if (cmd->group != next->group) + if (!no_groups && cmd->group != next->group) separator = double_separator; else separator = single_separator; diff --git a/tmux.h b/tmux.h index 180208e3..c738fb67 100644 --- a/tmux.h +++ b/tmux.h @@ -2689,6 +2689,8 @@ void cmd_list_append(struct cmd_list *, struct cmd *); void cmd_list_append_all(struct cmd_list *, struct cmd_list *); void cmd_list_move(struct cmd_list *, struct cmd_list *); void cmd_list_free(struct cmd_list *); +#define CMD_LIST_PRINT_ESCAPED 0x1 +#define CMD_LIST_PRINT_NO_GROUPS 0x2 char *cmd_list_print(const struct cmd_list *, int); struct cmd *cmd_list_first(struct cmd_list *); struct cmd *cmd_list_next(struct cmd *);