hv: shell: improve console to modify input easier

1. make memcpy_erms as a public API; add a new one
  memcpy_erms_backwards, which supports to copy data from tail to head.

  2. improve to use right/left/home/end key to move cursor, and support
delete/backspace key to modify current input command.

Tracked-On: #7931
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Minggui Cao
2022-07-20 13:15:32 +08:00
committed by acrnsi-robot
parent d5b2c82156
commit 83164d6030
4 changed files with 145 additions and 28 deletions

View File

@@ -36,6 +36,7 @@ struct shell {
int32_t input_line_active; /* Active input line index */
int32_t to_select_index; /* used for up/down key to select former cmds */
uint32_t cursor_offset; /* cursor offset position from left input line */
struct shell_cmd *cmds; /* cmds supported */
uint32_t cmd_count; /* Count of cmds supported */