Skip to content

Commit

Permalink
menu: Add clearer indications of what is wrong when config invalid or…
Browse files Browse the repository at this point in the history
… missing
  • Loading branch information
mintsuki committed Jul 21, 2024
1 parent ecf19e4 commit f50f46e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions common/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -889,9 +889,19 @@ noreturn void _menu(bool first_run) {
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;
Expand Down

0 comments on commit f50f46e

Please sign in to comment.