:: commit cea184b286e6a140e105d8b44f1bbb4e02bc03fa

Mintsuki <mintsuki@protonmail.com> — 2026-02-16 10:28

parents: 66fe9a7cce

menu: Fall back to text console instead of panicking on small terminals

diff --git a/common/menu.c b/common/menu.c
index 0411c559..7fba294f 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);
@@ -974,7 +974,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;
tab: 248 wrap: offon