Browse Source

cmd_shell: added auto suggest from history

- use right arrow to complete when suggestion matches
Daniel-Constantin Mierla 5 years ago
parent
commit
148fef52b4
1 changed files with 2 additions and 0 deletions
  1. 2 0
      kamcli/commands/cmd_shell.py

+ 2 - 0
kamcli/commands/cmd_shell.py

@@ -34,6 +34,7 @@ from prompt_toolkit.completion import Completer, Completion
 from prompt_toolkit.history import InMemoryHistory
 from prompt_toolkit.shortcuts import prompt
 from prompt_toolkit.history import FileHistory
+from prompt_toolkit.auto_suggest import AutoSuggestFromHistory
 from prompt_toolkit.styles import Style
 import os
 import shlex
@@ -200,6 +201,7 @@ def bootstrap_prompt(prompt_kwargs, group):
         "completer": ClickCompleter(group),
         "message": [("class:prompt", "kamcli > "),],
         "style": Style.from_dict({"prompt": "bold",}),
+        "auto_suggest": AutoSuggestFromHistory(),
     }
 
     for key in defaults: