summaryrefslogtreecommitdiffstats
path: root/server-client.c
diff options
context:
space:
mode:
authornicm <nicm>2020-05-16 15:06:03 +0000
committernicm <nicm>2020-05-16 15:06:03 +0000
commit80e52545a0cccba20fb4d96ed09ea2c129a30c93 (patch)
tree3998b7e13ca5b73e34e9e60f53c8d54e091ab5d7 /server-client.c
parentf03b61131b3407929fea187a309fb336017791d1 (diff)
Improve command prompt completion:
- Show a menu with completions if there are multiple. - Don't complete argument stuff (options, layouts) at start of text. - For -t and -s, if there is no : then complete sessions but if there is a :, show a menu of all windows in the session rather than trying to complete the window name which is a bit useless if there are duplicates.
Diffstat (limited to 'server-client.c')
-rw-r--r--server-client.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/server-client.c b/server-client.c
index ed138f8e..b21dac1d 100644
--- a/server-client.c
+++ b/server-client.c
@@ -1296,10 +1296,6 @@ server_client_handle_key(struct client *c, struct key_event *event)
*/
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:
@@ -1310,6 +1306,10 @@ server_client_handle_key(struct client *c, struct key_event *event)
}
}
server_client_clear_overlay(c);
+ if (c->prompt_string != NULL) {
+ if (status_prompt_key(c, event->key) == 0)
+ return (0);
+ }
}
/*
@@ -1564,6 +1564,8 @@ server_client_reset_state(struct client *c)
} else {
s = wp->screen;
mode = s->mode;
+ if (c->prompt_string != NULL || c->message_string != NULL)
+ mode &= ~MODE_CURSOR;
}
log_debug("%s: client %s mode %x", __func__, c->name, mode);