void cui_on_exit(struct pmenu *menu)
{
- cui_abort(cui_from_pmenu(menu));
+ struct cui *cui = cui_from_pmenu(menu);
+ char *sh_cmd;
+
+ sh_cmd = talloc_asprintf(cui,
+ "echo \"Exiting petitboot. Type 'exit' to return.\";\
+ echo \"You may run 'pb-sos' to gather diagnostic data\";\
+ %s", pb_system_apps.sh);
+
+ if (!sh_cmd) {
+ pb_log("Failed to allocate shell arguments\n");
+ return;
+ }
+
+ const char *argv[] = {
+ pb_system_apps.sh,
+ "-c",
+ sh_cmd,
+ NULL
+ };
+
+ cui_run_cmd(cui, argv);
+
+ nc_scr_status_printf(cui->current, _("Returned from shell"));
+ talloc_free(sh_cmd);
}
/**
nc_scr_status_printf(cui->current, _("Running %s..."), cmd_argv[0]);
+ nc_scr_unpost(cui->current);
+ clear();
+ refresh();
+
def_prog_mode();
endwin();
refresh();
redrawwin(cui->current->main_ncw);
+ nc_scr_post(cui->current);
if (result) {
pb_log("%s: failed: '%s'\n", __func__, cmd_argv[0]);
talloc_free(cod->name);
/* Name is still tabbed across */
- cod->name = talloc_asprintf(cod, " %s [installed]", opt->name);
+ cod->name = talloc_asprintf(cod, _(" %s [installed]"), opt->name);
cod->pd->opt = opt;
item->on_execute = NULL;
item_opts_off(i->nci, O_SELECTABLE);
pmenu_item_insert(m, i, 0);
- i = pmenu_item_create(m, ("Return to Main Menu"));
+ i = pmenu_item_create(m, _("Return to Main Menu"));
i->on_execute = pmenu_exit_cb;
pmenu_item_insert(m, i, 1);