summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-switch-client.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2020-05-16 15:45:30 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2020-05-16 15:45:30 +0000
commitdfbc90edaae2adf0ea3cb886f8ee4b66a44e37ef (patch)
tree06e217f8d61bea542c783579e303e476eaf9f768 /usr.bin/tmux/cmd-switch-client.c
parent01ab9014d083c10a7b2769e2593ab1931238dac5 (diff)
Change the existing client flags for control mode to apply for any
client, use the same mechanism for the read-only flag and add an ignore-size flag. refresh-client -F has become -f (-F stays for backwards compatibility) and attach-session and switch-client now have -f flags also. A new format "client_flags" lists the flags and is shown by list-clients by default. This separates the read-only flag from "ignore size" behaviour (new ignore-size) flag - both behaviours are useful in different circumstances. attach -r and switchc -r remain and set or toggle both flags together.
Diffstat (limited to 'usr.bin/tmux/cmd-switch-client.c')
-rw-r--r--usr.bin/tmux/cmd-switch-client.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.bin/tmux/cmd-switch-client.c b/usr.bin/tmux/cmd-switch-client.c
index a6a5a5507b3..2e8e3d484af 100644
--- a/usr.bin/tmux/cmd-switch-client.c
+++ b/usr.bin/tmux/cmd-switch-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-switch-client.c,v 1.65 2020/04/13 20:51:57 nicm Exp $ */
+/* $OpenBSD: cmd-switch-client.c,v 1.66 2020/05/16 15:45:29 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -34,7 +34,7 @@ const struct cmd_entry cmd_switch_client_entry = {
.name = "switch-client",
.alias = "switchc",
- .args = { "lc:Enpt:rT:Z", 0, 0 },
+ .args = { "lc:EFnpt:rT:Z", 0, 0 },
.usage = "[-ElnprZ] [-c target-client] [-t target-session] "
"[-T key-table]",
@@ -74,8 +74,12 @@ cmd_switch_client_exec(struct cmd *self, struct cmdq_item *item)
wl = target.wl;
wp = target.wp;
- if (args_has(args, 'r'))
- tc->flags ^= CLIENT_READONLY;
+ if (args_has(args, 'r')) {
+ if (tc->flags & CLIENT_READONLY)
+ tc->flags &= ~(CLIENT_READONLY|CLIENT_IGNORESIZE);
+ else
+ tc->flags |= (CLIENT_READONLY|CLIENT_IGNORESIZE);
+ }
tablename = args_get(args, 'T');
if (tablename != NULL) {