Revert detach-client part of last, did not intend this to go in.
authornicm <nicm@openbsd.org>
Thu, 21 Mar 2024 11:27:18 +0000 (11:27 +0000)
committernicm <nicm@openbsd.org>
Thu, 21 Mar 2024 11:27:18 +0000 (11:27 +0000)
usr.bin/tmux/cmd-detach-client.c

index ed4d3f3..25ceee3 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-detach-client.c,v 1.37 2024/03/21 11:26:28 nicm Exp $ */
+/* $OpenBSD: cmd-detach-client.c,v 1.38 2024/03/21 11:27:18 nicm Exp $ */
 
 /*
  * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -59,7 +59,6 @@ cmd_detach_client_exec(struct cmd *self, struct cmdq_item *item)
 {
        struct args             *args = cmd_get_args(self);
        struct cmd_find_state   *source = cmdq_get_source(item);
-       struct client           *c = cmdq_get_client(item);
        struct client           *tc = cmdq_get_target_client(item), *loop;
        struct session          *s;
        enum msgtype             msgtype;
@@ -102,13 +101,9 @@ cmd_detach_client_exec(struct cmd *self, struct cmdq_item *item)
                return (CMD_RETURN_NORMAL);
        }
 
-       if (cmd != NULL) {
-               if (c == NULL || c->session == NULL) {
-                       cmdq_error(item, "must be attached for -E");
-                       return (CMD_RETURN_ERROR);
-               }
+       if (cmd != NULL)
                server_client_exec(tc, cmd);
-       else
+       else
                server_client_detach(tc, msgtype);
        return (CMD_RETURN_STOP);
 }