Skip to contentSkip to conversation

[6784] Multi-key completion for sendkey

Qemu-devel Blue Swirl 1 participant 1 message Mar 8, 2009

lore
Share & tools
lore

Blue Swirl

author
#0 lore raw

Revision: 6784

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6784
Author:   blueswir1
Date:     2009-03-08 17:42:02 +0000 (Sun, 08 Mar 2009)

Log Message:
-----------
Multi-key completion for sendkey

Allow completion of concatenated key strings for the sendkey command.

Modified Paths:
--------------
trunk/monitor.c

Modified: trunk/monitor.c
===================================================================

monitor.c +3 -0
@@ -2957,6 +2957,9 @@
                     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);