:: commit d5a7284b69a597320fa81c4b6087c57ef68dfaca

Mintsuki <mintsuki@protonmail.com> — 2026-02-08 07:59

parents: 7b6ad6294f

menu: Reject terminals with fewer than 40 columns or 16 rows

diff --git a/common/menu.c b/common/menu.c
index a80e76c3..603ac0bc 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -177,6 +177,10 @@ static void putchar_tokencol(int type, char c) {
 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)");
+    }
+
     FOR_TERM(TERM->autoflush = false);
 
     FOR_TERM(TERM->cursor_enabled = true);
@@ -1052,6 +1056,10 @@ 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)");
+    }
+
     size_t tree_offset = 0;
 
 refresh:
tab: 248 wrap: offon