Skip to contentSkip to conversation

monitor: Multi-key completion for sendkey

PATCH In review Jan Kiszka 2 participants 2 messages Mar 8, 2009

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 monitor: Multi-key completion for sendkey

Allow completion of concatenated key strings for the sendkey command.

---

 monitor.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
monitor.c +3 -0
index 32dc4d5..44791c2 100644
@@ -2957,6 +2957,9 @@ static void monitor_find_completion(const char *cmdline)
                     cmd_completion(str, cmd->name);
                 }
             } else if (!strcmp(cmd->name, "sendkey")) {
+                char *sep = strrchr(str, '-');
+                if (sep)
+                    str = sep + 1;
                 readline_set_completion_index(cur_mon->rs, strlen(str));
                 for(key = key_defs; key->name != NULL; key++) {
                     cmd_completion(str, key->name);