summaryrefslogtreecommitdiffstats
path: root/server-client.c
diff options
context:
space:
mode:
authornicm <nicm>2019-07-02 20:09:19 +0000
committernicm <nicm>2019-07-02 20:09:19 +0000
commit6a489fa7f6360bcd9c0d6b87546d3eb6b0a3654a (patch)
tree9be23313f5db0dcac810b95079d68defd20bfae3 /server-client.c
parent2da050413c17e587be8bede710112096ce6b5f5a (diff)
Command prompt key presses need to avoid the command queue, GitHub issue
1817. Also a tmux.1 fix from jmc.
Diffstat (limited to 'server-client.c')
-rw-r--r--server-client.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/server-client.c b/server-client.c
index a982fe8e..7aeead41 100644
--- a/server-client.c
+++ b/server-client.c
@@ -1026,16 +1026,6 @@ server_client_key_callback(struct cmdq_item *item, void *data)
fatal("gettimeofday failed");
session_update_activity(s, &c->activity_time);
- /* Handle status line. */
- if (~c->flags & CLIENT_READONLY)
- status_message_clear(c);
- if (c->prompt_string != NULL) {
- if (c->flags & CLIENT_READONLY)
- goto out;
- if (status_prompt_key(c, key) == 0)
- goto out;
- }
-
/* Check for mouse keys. */
m->valid = 0;
if (key == KEYC_MOUSE) {
@@ -1216,16 +1206,24 @@ server_client_handle_key(struct client *c, struct key_event *event)
return (0);
/*
- * Key presses in overlay mode are a special case. The queue might be
- * blocked so they need to be processed immediately rather than queued.
+ * Key presses in overlay mode and the command prompt are a special
+ * case. The queue might be blocked so they need to be processed
+ * immediately rather than queued.
*/
- if ((~c->flags & CLIENT_READONLY) && c->overlay_key != NULL) {
- switch (c->overlay_key(c, event)) {
- case 0:
- return (0);
- case 1:
- server_client_clear_overlay(c);
- return (0);
+ if (~c->flags & CLIENT_READONLY) {
+ status_message_clear(c);
+ if (c->prompt_string != NULL) {
+ if (status_prompt_key(c, event->key) == 0)
+ return (0);
+ }
+ if (c->overlay_key != NULL) {
+ switch (c->overlay_key(c, event)) {
+ case 0:
+ return (0);
+ case 1:
+ server_client_clear_overlay(c);
+ return (0);
+ }
}
}