+ 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);