mirror of
https://github.com/tmux/tmux.git
synced 2025-04-10 02:58:50 +00:00
Cancel key table when switching session, unless the key is going to
repeat. Reported by Amos Bird.
This commit is contained in:
parent
d150d9b384
commit
e67548dc36
@ -98,6 +98,8 @@ cmd_attach_session(struct cmdq_item *item, int dflag, int rflag,
|
|||||||
environ_update(s->options, c->environ, s->environ);
|
environ_update(s->options, c->environ, s->environ);
|
||||||
|
|
||||||
c->session = s;
|
c->session = s;
|
||||||
|
if (!item->repeat)
|
||||||
|
server_client_set_key_table(c, NULL);
|
||||||
status_timer_start(c);
|
status_timer_start(c);
|
||||||
notify_client("client-session-changed", c);
|
notify_client("client-session-changed", c);
|
||||||
session_update_activity(s, NULL);
|
session_update_activity(s, NULL);
|
||||||
|
@ -277,6 +277,8 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
} else if (c->session != NULL)
|
} else if (c->session != NULL)
|
||||||
c->last_session = c->session;
|
c->last_session = c->session;
|
||||||
c->session = s;
|
c->session = s;
|
||||||
|
if (!item->repeat)
|
||||||
|
server_client_set_key_table(c, NULL);
|
||||||
status_timer_start(c);
|
status_timer_start(c);
|
||||||
notify_client("client-session-changed", c);
|
notify_client("client-session-changed", c);
|
||||||
session_update_activity(s, NULL);
|
session_update_activity(s, NULL);
|
||||||
|
@ -108,6 +108,8 @@ cmd_switch_client_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
if (c->session != NULL && c->session != s)
|
if (c->session != NULL && c->session != s)
|
||||||
c->last_session = c->session;
|
c->last_session = c->session;
|
||||||
c->session = s;
|
c->session = s;
|
||||||
|
if (!item->repeat)
|
||||||
|
server_client_set_key_table(c, NULL);
|
||||||
status_timer_start(c);
|
status_timer_start(c);
|
||||||
session_update_activity(s, NULL);
|
session_update_activity(s, NULL);
|
||||||
gettimeofday(&s->last_attached_time, NULL);
|
gettimeofday(&s->last_attached_time, NULL);
|
||||||
|
@ -400,8 +400,9 @@ void
|
|||||||
key_bindings_dispatch(struct key_binding *bd, struct client *c,
|
key_bindings_dispatch(struct key_binding *bd, struct client *c,
|
||||||
struct mouse_event *m, struct cmd_find_state *fs)
|
struct mouse_event *m, struct cmd_find_state *fs)
|
||||||
{
|
{
|
||||||
struct cmd *cmd;
|
struct cmd *cmd;
|
||||||
int readonly;
|
struct cmdq_item *item;
|
||||||
|
int readonly;
|
||||||
|
|
||||||
readonly = 1;
|
readonly = 1;
|
||||||
TAILQ_FOREACH(cmd, &bd->cmdlist->list, qentry) {
|
TAILQ_FOREACH(cmd, &bd->cmdlist->list, qentry) {
|
||||||
@ -410,6 +411,9 @@ key_bindings_dispatch(struct key_binding *bd, struct client *c,
|
|||||||
}
|
}
|
||||||
if (!readonly && (c->flags & CLIENT_READONLY))
|
if (!readonly && (c->flags & CLIENT_READONLY))
|
||||||
cmdq_append(c, cmdq_get_callback(key_bindings_read_only, NULL));
|
cmdq_append(c, cmdq_get_callback(key_bindings_read_only, NULL));
|
||||||
else
|
else {
|
||||||
cmdq_append(c, cmdq_get_command(bd->cmdlist, fs, m, 0));
|
item = cmdq_get_command(bd->cmdlist, fs, m, 0);
|
||||||
|
item->repeat = bd->can_repeat;
|
||||||
|
cmdq_append(c, item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user