mirror of
https://github.com/tmux/tmux.git
synced 2025-01-12 03:08:46 +00:00
Add various checks to turn off bits that can't work in control mode (such as
lock).
This commit is contained in:
parent
d1e8fb33da
commit
3d9fd1c7f2
@ -355,6 +355,7 @@ server_client_handle_key(struct client *c, int key)
|
|||||||
/* Check the client is good to accept input. */
|
/* Check the client is good to accept input. */
|
||||||
if ((c->flags & (CLIENT_DEAD|CLIENT_SUSPENDED)) != 0)
|
if ((c->flags & (CLIENT_DEAD|CLIENT_SUSPENDED)) != 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (c->session == NULL)
|
if (c->session == NULL)
|
||||||
return;
|
return;
|
||||||
s = c->session;
|
s = c->session;
|
||||||
@ -528,6 +529,9 @@ server_client_reset_state(struct client *c)
|
|||||||
if (c->flags & CLIENT_SUSPENDED)
|
if (c->flags & CLIENT_SUSPENDED)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (c->flags & CLIENT_CONTROL)
|
||||||
|
return;
|
||||||
|
|
||||||
tty_region(&c->tty, 0, c->tty.sy - 1);
|
tty_region(&c->tty, 0, c->tty.sy - 1);
|
||||||
|
|
||||||
status = options_get_number(oo, "status");
|
status = options_get_number(oo, "status");
|
||||||
@ -625,7 +629,7 @@ server_client_check_redraw(struct client *c)
|
|||||||
struct window_pane *wp;
|
struct window_pane *wp;
|
||||||
int flags, redraw;
|
int flags, redraw;
|
||||||
|
|
||||||
if (c->flags & CLIENT_SUSPENDED)
|
if (c->flags & (CLIENT_CONTROL|CLIENT_SUSPENDED))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
flags = c->tty.flags & TTY_FREEZE;
|
flags = c->tty.flags & TTY_FREEZE;
|
||||||
@ -755,6 +759,8 @@ server_client_msg_dispatch(struct client *c)
|
|||||||
if (datalen != 0)
|
if (datalen != 0)
|
||||||
fatalx("bad MSG_RESIZE size");
|
fatalx("bad MSG_RESIZE size");
|
||||||
|
|
||||||
|
if (c->flags & CLIENT_CONTROL)
|
||||||
|
break;
|
||||||
if (tty_resize(&c->tty)) {
|
if (tty_resize(&c->tty)) {
|
||||||
recalculate_sizes();
|
recalculate_sizes();
|
||||||
server_redraw_client(c);
|
server_redraw_client(c);
|
||||||
@ -924,7 +930,7 @@ server_client_msg_identify(
|
|||||||
|
|
||||||
if (data->flags & IDENTIFY_CONTROL) {
|
if (data->flags & IDENTIFY_CONTROL) {
|
||||||
c->stdin_callback = control_callback;
|
c->stdin_callback = control_callback;
|
||||||
c->flags |= (CLIENT_CONTROL|CLIENT_SUSPENDED);
|
c->flags |= CLIENT_CONTROL;
|
||||||
server_write_client(c, MSG_STDIN, NULL, 0);
|
server_write_client(c, MSG_STDIN, NULL, 0);
|
||||||
|
|
||||||
c->tty.fd = -1;
|
c->tty.fd = -1;
|
||||||
@ -949,7 +955,8 @@ server_client_msg_identify(
|
|||||||
|
|
||||||
tty_resize(&c->tty);
|
tty_resize(&c->tty);
|
||||||
|
|
||||||
c->flags |= CLIENT_TERMINAL;
|
if (!(data->flags & IDENTIFY_CONTROL))
|
||||||
|
c->flags |= CLIENT_TERMINAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle shell message. */
|
/* Handle shell message. */
|
||||||
|
@ -239,6 +239,9 @@ server_lock_client(struct client *c)
|
|||||||
size_t cmdlen;
|
size_t cmdlen;
|
||||||
struct msg_lock_data lockdata;
|
struct msg_lock_data lockdata;
|
||||||
|
|
||||||
|
if (!(c->flags & CLIENT_CONTROL))
|
||||||
|
return;
|
||||||
|
|
||||||
if (c->flags & CLIENT_SUSPENDED)
|
if (c->flags & CLIENT_SUSPENDED)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ server_window_check_bell(struct session *s, struct winlink *wl)
|
|||||||
return (0);
|
return (0);
|
||||||
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
|
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
|
||||||
c = ARRAY_ITEM(&clients, i);
|
c = ARRAY_ITEM(&clients, i);
|
||||||
if (c == NULL || c->session != s)
|
if (c == NULL || c->session != s || (c->flags & CLIENT_CONTROL))
|
||||||
continue;
|
continue;
|
||||||
if (!visual) {
|
if (!visual) {
|
||||||
tty_bell(&c->tty);
|
tty_bell(&c->tty);
|
||||||
@ -242,7 +242,7 @@ ring_bell(struct session *s)
|
|||||||
|
|
||||||
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
|
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
|
||||||
c = ARRAY_ITEM(&clients, i);
|
c = ARRAY_ITEM(&clients, i);
|
||||||
if (c != NULL && c->session == s)
|
if (c != NULL && c->session == s && !(c->flags & CLIENT_CONTROL))
|
||||||
tty_bell(&c->tty);
|
tty_bell(&c->tty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user