From 419cc25aa15784510a276f78441efbaf470b8577 Mon Sep 17 00:00:00 2001 From: Casey Connolly Date: Thu, 23 Oct 2025 16:26:46 +0200 Subject: efi_loader: efi_console: support editable input fields When editing eficonfig "optional data" (typically cmdline arguments) it's useful to be able to edit the string rather than having to re-type the entire thing. Implement support for editing buffers to make this a whole lot nicer. Specifically, add support for moving the cursor with the arrow keys and End key as well as deleting backwards with the delete key. Signed-off-by: Casey Connolly Acked-by: Ilias Apalodimas Tested-by: Ilias Apalodimas Signed-off-by: Heinrich Schuchardt --- cmd/eficonfig.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cmd') diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c index 8ac0fb98e02..d8d946c87ac 100644 --- a/cmd/eficonfig.c +++ b/cmd/eficonfig.c @@ -974,6 +974,8 @@ static efi_status_t handle_user_input(u16 *buf, int buf_size, if (!tmp) return EFI_OUT_OF_RESOURCES; + /* Populate tmp so user can edit existing string */ + u16_strcpy(tmp, buf); ret = efi_console_get_u16_string(cin, tmp, buf_size, NULL, 4, cursor_col); if (ret == EFI_SUCCESS) u16_strcpy(buf, tmp); -- cgit v1.2.3