:: commit f50f46eca7697f3e233fe20fbfb04fb6ffd2cec2

mintsuki <mintsuki@protonmail.com> — 2024-07-21 11:59

parents: ecf19e4766

menu: Add clearer indications of what is wrong when config invalid or missing

diff --git a/common/menu.c b/common/menu.c
index 8a5107c0..48e9a731 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -889,9 +889,19 @@ refresh:
         print("\n\n\n\n");
     }
 
-    if (menu_tree == NULL && quiet) {
-        quiet = false;
-        menu_init_term();
+    if (menu_tree == NULL) {
+        if (quiet) {
+            quiet = false;
+            menu_init_term();
+        }
+        const char *msg;
+        if (config_ready) {
+            msg = "[config file contains no valid entries]";
+        } else {
+            msg = "[config file not found]";
+        }
+        set_cursor_pos_helper(terms[0]->cols / 2 - strlen(msg) / 2, terms[0]->rows / 2);
+        print("%s\n", msg);
     }
 
     size_t max_tree_len, max_tree_height;
tab: 248 wrap: offon