diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2020-05-05 15:42:20 +0100 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2020-05-05 15:42:20 +0100 |
commit | 2f89d2e7d816918e152aacfee85fab45ee2057b9 (patch) | |
tree | 98f86226f36a6bf5e1a88bef8ca1d6cdb02612b8 /cmd-new-session.c | |
parent | deacfedc65e6de6b3f84348d6723ae6f14d097df (diff) | |
download | rtmux-2f89d2e7d816918e152aacfee85fab45ee2057b9.tar.gz rtmux-2f89d2e7d816918e152aacfee85fab45ee2057b9.tar.bz2 rtmux-2f89d2e7d816918e152aacfee85fab45ee2057b9.zip |
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 'cmd-new-session.c')
-rw-r--r-- | cmd-new-session.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/cmd-new-session.c b/cmd-new-session.c index 9815e1e1..a9a0376b 100644 --- a/cmd-new-session.c +++ b/cmd-new-session.c @@ -39,9 +39,9 @@ const struct cmd_entry cmd_new_session_entry = { .name = "new-session", .alias = "new", - .args = { "Ac:dDe:EF:n:Ps:t:x:Xy:", 0, -1 }, + .args = { "Ac:dDe:EF:f:n:Ps:t:x:Xy:", 0, -1 }, .usage = "[-AdDEPX] [-c start-directory] [-e environment] [-F format] " - "[-n window-name] [-s session-name] " + "[-f flags] [-n window-name] [-s session-name] " CMD_TARGET_SESSION_USAGE " [-x width] [-y height] [command]", .target = { 't', CMD_FIND_SESSION, CMD_FIND_CANFAIL }, @@ -112,7 +112,7 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) if (as != NULL) { retval = cmd_attach_session(item, as->name, args_has(args, 'D'), args_has(args, 'X'), 0, NULL, - args_has(args, 'E')); + args_has(args, 'E'), args_get(args, 'f')); free(newname); return (retval); } @@ -306,6 +306,8 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) * taking this session and needs to get MSG_READY and stay around. */ if (!detached) { + if (args_has(args, 'f')) + server_client_set_flags(c, args_get(args, 'f')); if (!already_attached) { if (~c->flags & CLIENT_CONTROL) proc_send(c->peer, MSG_READY, -1, NULL, 0); |