=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-queue.c,v retrieving revision 1.92 retrieving revision 1.93 diff -c -r1.92 -r1.93 *** src/usr.bin/tmux/cmd-queue.c 2020/05/16 15:40:04 1.92 --- src/usr.bin/tmux/cmd-queue.c 2020/05/16 15:47:22 1.93 *************** *** 1,4 **** ! /* $OpenBSD: cmd-queue.c,v 1.92 2020/05/16 15:40:04 nicm Exp $ */ /* * Copyright (c) 2013 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-queue.c,v 1.93 2020/05/16 15:47:22 nicm Exp $ */ /* * Copyright (c) 2013 Nicholas Marriott *************** *** 534,539 **** --- 534,561 ---- return (CMD_RETURN_NORMAL); } + /* Add message with command. */ + static void + cmdq_add_message(struct cmdq_item *item) + { + struct client *c = item->client; + struct cmdq_state *state = item->state; + const char *name, *key; + char *tmp; + + tmp = cmd_print(item->cmd); + if (c != NULL) { + name = c->name; + if (c->session != NULL && state->event.key != KEYC_NONE) { + key = key_string_lookup_key(state->event.key); + server_add_message("%s key %s: %s", name, key, tmp); + } else + server_add_message("%s command: %s", name, tmp); + } else + server_add_message("command: %s", tmp); + free(tmp); + } + /* Fire command on command queue. */ static enum cmd_retval cmdq_fire_command(struct cmdq_item *item) *************** *** 549,554 **** --- 571,578 ---- int flags, quiet = 0; char *tmp; + if (cfg_finished) + cmdq_add_message(item); if (log_get_level() > 1) { tmp = cmd_print(cmd); log_debug("%s %s: (%u) %s", __func__, name, item->group, tmp); *************** *** 819,824 **** --- 843,849 ---- cmd_get_source(cmd, &file, &line); cfg_add_cause("%s:%u: %s", file, line, msg); } else if (c->session == NULL || (c->flags & CLIENT_CONTROL)) { + server_add_message("%s message: %s", c->name, msg); if (~c->flags & CLIENT_UTF8) { tmp = msg; msg = utf8_sanitize(tmp);