summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2016-12-24 12:00:00 +0100
committerRichard Braun <rbraun@sceen.net>2016-12-24 12:00:00 +0100
commitb4ea88ef4530f450ce2b44c2f09c510f2bea0f9b (patch)
tree8458ec53e24f3d711c55964a9905bb40d62ab6c2
parentb5d93168c2996d314a8cc79cd6939c34f1ac7fe7 (diff)
shell: fix completion regression
Commit 5b0ec6b075662d24fb72acf394335731fd9db5ba introduced a regression where arguments already input by the user would be erased instead of preserved. This change fixes this.
-rw-r--r--shell.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/shell.c b/shell.c
index 9040824..e91cb90 100644
--- a/shell.c
+++ b/shell.c
@@ -854,9 +854,17 @@ shell_process_tabulation(void)
}
if (error == ERR_AGAIN) {
+ unsigned long cursor;
+
+ cursor = shell_cursor;
shell_cmd_print_matches(cmd, size);
shell_prompt();
shell_restore();
+
+ /* Keep existing arguments as they are */
+ while (shell_cursor != cursor) {
+ shell_process_left();
+ }
}
name = shell_cmd_name(cmd);