mirror of
https://github.com/tmux/tmux.git
synced 2024-12-13 01:48:47 +00:00
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.
This commit is contained in:
parent
9dc6946ebf
commit
2dc9bfd93a
@ -67,8 +67,10 @@ cmd_refresh_client_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
cmdq_error(item, "not a control client");
|
cmdq_error(item, "not a control client");
|
||||||
return (CMD_RETURN_ERROR);
|
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();
|
recalculate_sizes();
|
||||||
|
}
|
||||||
} else if (args_has(args, 'S')) {
|
} else if (args_has(args, 'S')) {
|
||||||
c->flags |= CLIENT_STATUSFORCE;
|
c->flags |= CLIENT_STATUSFORCE;
|
||||||
server_status_client(c);
|
server_status_client(c);
|
||||||
|
3
resize.c
3
resize.c
@ -60,6 +60,9 @@ recalculate_sizes(void)
|
|||||||
TAILQ_FOREACH(c, &clients, entry) {
|
TAILQ_FOREACH(c, &clients, entry) {
|
||||||
if (c->flags & CLIENT_SUSPENDED)
|
if (c->flags & CLIENT_SUSPENDED)
|
||||||
continue;
|
continue;
|
||||||
|
if ((c->flags & (CLIENT_CONTROL|CLIENT_SIZECHANGED)) ==
|
||||||
|
CLIENT_CONTROL)
|
||||||
|
continue;
|
||||||
if (c->session == s) {
|
if (c->session == s) {
|
||||||
if (c->tty.sx < ssx)
|
if (c->tty.sx < ssx)
|
||||||
ssx = c->tty.sx;
|
ssx = c->tty.sx;
|
||||||
|
1
tmux.h
1
tmux.h
@ -1345,6 +1345,7 @@ struct client {
|
|||||||
#define CLIENT_STATUSFORCE 0x80000
|
#define CLIENT_STATUSFORCE 0x80000
|
||||||
#define CLIENT_DOUBLECLICK 0x100000
|
#define CLIENT_DOUBLECLICK 0x100000
|
||||||
#define CLIENT_TRIPLECLICK 0x200000
|
#define CLIENT_TRIPLECLICK 0x200000
|
||||||
|
#define CLIENT_SIZECHANGED 0x400000
|
||||||
int flags;
|
int flags;
|
||||||
struct key_table *keytable;
|
struct key_table *keytable;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user