From 8ed11439cec7e2dbb7ee9370a6c6f6aaf3c91d46 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 19 Dec 2022 07:30:10 +0000 Subject: [PATCH] Allow send-keys without a client again, reported by Stefan Hagen. --- usr.bin/tmux/cmd-send-keys.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.bin/tmux/cmd-send-keys.c b/usr.bin/tmux/cmd-send-keys.c index e65597781e8..c8ee97f2295 100644 --- a/usr.bin/tmux/cmd-send-keys.c +++ b/usr.bin/tmux/cmd-send-keys.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-send-keys.c,v 1.73 2022/12/16 08:13:40 nicm Exp $ */ +/* $OpenBSD: cmd-send-keys.c,v 1.74 2022/12/19 07:30:10 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -39,7 +39,7 @@ const struct cmd_entry cmd_send_keys_entry = { .target = { 't', CMD_FIND_PANE, 0 }, - .flags = CMD_AFTERHOOK|CMD_CLIENT_CFLAG, + .flags = CMD_AFTERHOOK|CMD_CLIENT_CFLAG|CMD_CLIENT_CANFAIL, .exec = cmd_send_keys_exec }; @@ -71,6 +71,8 @@ cmd_send_keys_inject_key(struct cmdq_item *item, struct cmdq_item *after, struct key_event *event; if (args_has(args, 'K')) { + if (tc == NULL) + return (item); event = xmalloc(sizeof *event); event->key = key; memset(&event->m, 0, sizeof event->m); -- 2.20.1