video: Provide a way to indicate the start of CLI entry
Add a new mark_start() method for the console, which indicates that the CLI prompt has been written to the display and any following characters will be user input. There are two cases to consider, tracked by an indent flag in struct vidconsole_cursor: - normal CLI entry where new lines start at the left of the console - expo entry where new lines start at the same position as the previous line (indent=true) Record this position in the uclass info, so it is available to console drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include <pager.h>
|
||||
#include <time.h>
|
||||
#include <watchdog.h>
|
||||
#include <video_console.h>
|
||||
#include <linux/errno.h>
|
||||
#include <asm/global_data.h>
|
||||
|
||||
@@ -676,6 +677,8 @@ int cli_readline_into_buffer(const char *const prompt, char *buffer,
|
||||
if (prompt)
|
||||
puts(prompt);
|
||||
|
||||
/* tell the vidconsole the cursor is at its start position */
|
||||
vidconsole_readline_start(false);
|
||||
rc = cread_line(prompt, p, &len, timeout);
|
||||
rc = rc < 0 ? rc : len;
|
||||
|
||||
@@ -686,5 +689,7 @@ int cli_readline_into_buffer(const char *const prompt, char *buffer,
|
||||
pager_set_bypass(gd_pager(), old_bypass);
|
||||
pager_reset(gd_pager());
|
||||
|
||||
vidconsole_readline_end();
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user