Skip to contentSkip to conversation

menu: Add ctrl-L to refresh the menu

PATCH New Benjamin Herrenschmidt 1 participant 1 message Oct 7, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 menu: Add ctrl-L to refresh the menu

This is useful on cloud instances with remote serial ports as it can be difficult to connect "fast enough" to get the initial menu display

---
 docs/grub.texi          | 3 +++
 grub-core/normal/menu.c | 4 ++++
 2 files changed, 7 insertions(+)
docs/grub.texi +3 -0
index 211cddc01..0dbbdc374 100644
@@ -3222,6 +3222,9 @@ If you protect the menu interface with a password (@pxref{Security}),
 all you can do is choose an entry by pressing @key{RET}, or press
 @key{p} to enter the password.
 
+Pressing @key{Ctrl-l} will refresh the menu, which can be useful when
+connecting via serial after the menu has been drawn.
+
 
 @node Menu entry editor
 @section Editing a menu entry
grub-core/normal/menu.c +4 -0
index fa4871a62..6a90e091f 100644
@@ -788,6 +788,10 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot, int *notify_boot)
 		}
 	      goto refresh;
 
+	    case GRUB_TERM_CTRL | 'l':
+	      menu_fini ();
+	      goto refresh;
+
 	    default:
 	      {
 		int entry;