diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2017-05-10 16:48:37 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2017-05-10 16:48:37 +0000 |
commit | d6a9b2a5c7010fc7533dd012f181e4d548835059 (patch) | |
tree | 8543cafeaa698c02528e643dc46bcbeffd9ca103 /usr.bin/tmux | |
parent | f062d033d9d58c1007507b1ba38f3423804a5ff1 (diff) |
Prevent control clients from affecting the session size until they have
specified a size with refresh-client -C. Prompted by a different change
with the same purpose from George Nachman.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r-- | usr.bin/tmux/cmd-refresh-client.c | 6 | ||||
-rw-r--r-- | usr.bin/tmux/resize.c | 5 | ||||
-rw-r--r-- | usr.bin/tmux/tmux.h | 3 |
3 files changed, 10 insertions, 4 deletions
diff --git a/usr.bin/tmux/cmd-refresh-client.c b/usr.bin/tmux/cmd-refresh-client.c index 52d3dcb5d1f..c1faf12ceb6 100644 --- a/usr.bin/tmux/cmd-refresh-client.c +++ b/usr.bin/tmux/cmd-refresh-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-refresh-client.c,v 1.24 2017/04/22 10:22:39 nicm Exp $ */ +/* $OpenBSD: cmd-refresh-client.c,v 1.25 2017/05/10 16:48:36 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -67,8 +67,10 @@ cmd_refresh_client_exec(struct cmd *self, struct cmdq_item *item) cmdq_error(item, "not a control client"); return (CMD_RETURN_ERROR); } - if (tty_set_size(&c->tty, w, h)) + if (tty_set_size(&c->tty, w, h)) { + c->flags |= CLIENT_SIZECHANGED; recalculate_sizes(); + } } else if (args_has(args, 'S')) { c->flags |= CLIENT_STATUSFORCE; server_status_client(c); diff --git a/usr.bin/tmux/resize.c b/usr.bin/tmux/resize.c index 4914ae6af95..b67005d2263 100644 --- a/usr.bin/tmux/resize.c +++ b/usr.bin/tmux/resize.c @@ -1,4 +1,4 @@ -/* $OpenBSD: resize.c,v 1.22 2017/02/08 13:53:32 nicm Exp $ */ +/* $OpenBSD: resize.c,v 1.23 2017/05/10 16:48:36 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -60,6 +60,9 @@ recalculate_sizes(void) TAILQ_FOREACH(c, &clients, entry) { if (c->flags & CLIENT_SUSPENDED) continue; + if ((c->flags & (CLIENT_CONTROL|CLIENT_SIZECHANGED)) == + CLIENT_CONTROL) + continue; if (c->session == s) { if (c->tty.sx < ssx) ssx = c->tty.sx; diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h index abd44b4d163..91cec8787e5 100644 --- a/usr.bin/tmux/tmux.h +++ b/usr.bin/tmux/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.762 2017/05/10 10:46:59 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.763 2017/05/10 16:48:36 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -1345,6 +1345,7 @@ struct client { #define CLIENT_STATUSFORCE 0x80000 #define CLIENT_DOUBLECLICK 0x100000 #define CLIENT_TRIPLECLICK 0x200000 +#define CLIENT_SIZECHANGED 0x400000 int flags; struct key_table *keytable; |