diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2020-04-29 13:56:10 +0100 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2020-04-29 13:56:10 +0100 |
commit | b06235c345d8d6426d3c8208b4e475e6c60ac884 (patch) | |
tree | 496515ffeaeebeaba5f1e660a7e2b111ea86abdf /server-client.c | |
parent | 7c52d702e4bb6d3783984001678f5be98b56b7e6 (diff) | |
download | rtmux-b06235c345d8d6426d3c8208b4e475e6c60ac884.tar.gz rtmux-b06235c345d8d6426d3c8208b4e475e6c60ac884.tar.bz2 rtmux-b06235c345d8d6426d3c8208b4e475e6c60ac884.zip |
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.
Lots of scope for being more sophisticated left here.
Diffstat (limited to 'server-client.c')
-rw-r--r-- | server-client.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/server-client.c b/server-client.c index 92b3a6ad..5f7ce6b8 100644 --- a/server-client.c +++ b/server-client.c @@ -1294,10 +1294,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: @@ -1308,6 +1304,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); + } } /* @@ -1562,6 +1562,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); |