menu: Fall back to text console instead of panicking on small terminals
diff --git a/common/menu.c b/common/menu.c
index 5a8c902f..b45f2109 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -178,7 +178,7 @@ static bool editor_no_term_reset = false;
char *config_entry_editor(const char *title, const char *orig_entry) {
if (terms[0]->cols < 40 || terms[0]->rows < 16) {
- panic(false, "Terminal too small (minimum 40x16 required)");
+ return NULL;
}
FOR_TERM(TERM->autoflush = false);
@@ -1057,7 +1057,13 @@ noreturn void _menu(bool first_run) {
menu_init_term();
if (terms[0]->cols < 40 || terms[0]->rows < 16) {
- panic(false, "Terminal too small (minimum 40x16 required)");
+ // Terminal too small for menu, fall back to text console
+#if defined (BIOS)
+ vga_textmode_init(true);
+#elif defined (UEFI)
+ serial = true;
+ term_fallback();
+#endif
}
size_t tree_offset = 0;
